• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript chalk.yellow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中chalk.yellow的典型用法代码示例。如果您正苦于以下问题:TypeScript yellow类的具体用法?TypeScript yellow怎么用?TypeScript yellow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了yellow类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: format

  /**
   * Format the log with an appropriate colour
   * @param logLevel
   * @param message
   * @returns {string}
   */
  public format(logLevel: LogLevel, message: string) {
    switch (logLevel) {
      case 'emergency':
        message = bgRed(message);
        break;
      case 'alert':
        message = red.underline(message);
        break;
      case 'critical':
        message = yellow.underline(message);
        break;
      case 'warning':
        message = yellow(message);
        break;
      case 'notice':
        message = magenta(message);
        break;
      case 'info':
        message = blue(message);
        break;
      case 'debug':
        message = gray(message);
        break;
    }

    return message;
  }
开发者ID:ubiquits,项目名称:ubiquits,代码行数:33,代码来源:consoleLogger.service.ts


示例2: _validateSequenceNumber

    private _validateSequenceNumber(sequenceNumber: number) {

        // checking that sequenceNumber is increasing
        assert(_.isFinite(this._previousSequenceNumber));
        assert(_.isFinite(sequenceNumber) && sequenceNumber >= 0);

        let expectedSequenceNumber;
        if (this._previousSequenceNumber !== -1) {

            expectedSequenceNumber = this._previousSequenceNumber + 1;

            if (expectedSequenceNumber !== sequenceNumber) {
                const errMessage = "Invalid Sequence Number found ( expected " + expectedSequenceNumber + ", got " + sequenceNumber + ")";

                /* istanbul ignore next */
                debugLog(chalk.red.bold(errMessage));
                /**
                 * notify the observers that a message with an invalid sequence number has been received.
                 * @event invalid_sequence_number
                 * @param  expected sequence Number
                 * @param  actual sequence Number
                 */
                this.emit("invalid_sequence_number", expectedSequenceNumber, sequenceNumber);
            }
            // todo : handle the case where sequenceNumber wraps back to < 1024
        }
        /* istanbul ignore next */
        if (doDebug) {
            debugLog(chalk.yellow.bold(" Sequence Number = "), sequenceNumber);
        }
        this._previousSequenceNumber = sequenceNumber;
    }
开发者ID:node-opcua,项目名称:node-opcua,代码行数:32,代码来源:message_builder.ts


示例3: showWarnings

/**
 * Show warnings for the errors that occured during mapping of files, we
 * still give the user to continue deployment without those files.
 *
 * @param {string} resolvedPath
 * @param {FileError[]} errors
 */
async function showWarnings(resolvedPath: string, errors: FileError[]) {
  if (errors.length > 0) {
    console.log();
    log(
      chalk.yellow(
        `There are ${chalk.bold(
          errors.length.toString(),
        )} files that cannot be uploaded:`,
      ),
    );
    for (const error of errors) {
      const relativePath = error.path.replace(resolvedPath, '');

      log(`${chalk.yellow.bold(relativePath)}: ${error.message}`);
    }
  }

  console.log();
  log(
    chalk.yellow(
      'File hosting using the ' +
        chalk.bold('public') +
        ' folder is not supported yet.',
    ),
  );
  console.log();
}
开发者ID:ghoullier,项目名称:codesandbox-cli,代码行数:34,代码来源:deploy.ts


示例4: logCodeSandbox

export function logCodeSandbox() {
  console.log(
    `  ${chalk.blue.bold('Code')}${chalk.yellow.bold('Sandbox')} ${chalk.bold(
      'CLI',
    )}`,
  );
  console.log('  The official CLI for uploading projects to CodeSandbox');
}
开发者ID:ghoullier,项目名称:codesandbox-cli,代码行数:8,代码来源:log.ts


示例5: setTimeout

 setTimeout(() => {
   console.warn(
     chalk.yellow.bold(
       'Jest did not exit one second after the test run has completed.\n\n',
     ) +
       chalk.yellow(
         'This usually means that there are asynchronous operations that ' +
           "weren't stopped in your tests. Consider running Jest with " +
           '`--detectOpenHandles` to troubleshoot this issue.',
       ),
   );
 }, 1000).unref();
开发者ID:facebook,项目名称:jest,代码行数:12,代码来源:index.ts


示例6:

renderer.em = (text) => {
    return chalk.yellow.bold(text);
};
开发者ID:bvkimball,项目名称:linguist,代码行数:3,代码来源:MarkedRenderer.ts


示例7: info

function info(...args: any[]) {
    console.log(chalk.yellow.apply(null, args));
}
开发者ID:bytearcher,项目名称:gaze-run-interrupt,代码行数:3,代码来源:index.ts


示例8: debugLog

        secureChannel.on("close", (err?: Error) => {

            debugLog(chalk.yellow.bold(" ClientBaseImpl emitting close"), err);

            if (!err || !this.reconnectOnFailure) {

                // this is a normal close operation initiated byu

                /**
                 * @event close
                 * @param error
                 */
                this.emit("close", err);

                setImmediate(() => {
                    this._destroy_secure_channel();
                });
                return;

            } else {

                this.emit("connection_lost");

                setImmediate(() => {

                    debugLog("recreating new secure channel ");

                    this._recreate_secure_channel((err1?: Error) => {

                        debugLog("secureChannel#on(close) => _recreate_secure_channel returns ",
                          err1 ? err1.message : "OK");

                        if (err1) {
                            // xx assert(!this._secureChannel);
                            debugLog("_recreate_secure_channel has failed");
                            // xx this.emit("close", err1);
                            return;
                        } else {
                            /**
                             * @event connection_reestablished
                             *        send when the connection is reestablished after a connection break
                             */
                            this.emit("connection_reestablished");

                            // now delegate to upper class the
                            if (this._on_connection_reestablished) {
                                assert(_.isFunction(this._on_connection_reestablished));
                                this._on_connection_reestablished((err2?: Error) => {

                                    if (err2) {
                                        debugLog("connection_reestablished has failed");
                                        this.disconnect(() => {
                                            //  callback(err);
                                        });
                                    }
                                });
                            }
                        }
                    });
                });
            }
        });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:62,代码来源:client_base_impl.ts


示例9: it

    it("should findReferenceEx", () => {

        const nsDI = addressSpace.getNamespaceIndex("http://opcfoundation.org/UA/DI/");
        const topologyElementType = addressSpace.findObjectType("TopologyElementType", nsDI)!;

        const deviceType = addressSpace.findObjectType("DeviceType", nsDI)!;

        function isMandatory(reference: UAReference) {
            // xx console.log(reference.node.modellingRule ,
            // reference._referenceType.browseName.toString(),reference.node.browseName.toString());
            if (!reference.node!.modellingRule) {
                return false;
            }
            (typeof reference.node!.modellingRule === "string").should.eql(true);
            return reference.node!.modellingRule === "Mandatory" || reference.node!.modellingRule === "Optional";
        }

        const r1_child = deviceType.findReferencesEx("Aggregates")
          .filter((x: UAReference) => isMandatory(x))
          .map((x: UAReference) => x.node!.browseName.name!.toString());

        const r1_components = deviceType.findReferencesEx("HasComponent")
          .filter((x: UAReference) => isMandatory(x))
          .map((x: UAReference) => x.node!.browseName.name!.toString());

        const r1_properties = deviceType.findReferencesEx("HasProperty")
          .filter((x: UAReference) => isMandatory(x))
          .map((x: UAReference) => x.node!.browseName.name!.toString());

        console.log("Aggregates from ", deviceType.browseName.toString(), ": ",
          chalk.yellow.bold(r1_child.sort().join(" ")));

        r1_child.length.should.be.greaterThan(1);

        ([] as string[]).concat(r1_components, r1_properties).sort().should.eql(r1_child.sort());

        const r2_child = topologyElementType.findReferencesEx("Aggregates")!
          .filter((x: UAReference) => isMandatory(x))
          .map((x: UAReference) => x.node!.browseName.name!.toString());

        r2_child.length.should.be.greaterThan(1);

        console.log("Aggregates from ", topologyElementType.browseName.toString(), ": ",
          chalk.yellow.bold(r2_child.sort().join(" ")));

        const optionals = ([] as string[]).concat(r1_child.sort(), r2_child.sort());
        console.log("optionals ", topologyElementType.browseName.toString(), ": ",
          chalk.yellow.bold( optionals.join(" ") ));

        const valveType = addressSpace.getOwnNamespace().addObjectType({
            browseName: "ValveType",
            subtypeOf: deviceType
        });

        const someDevice = valveType.instantiate({
            browseName: "SomeDevice",
            // let make sure that all properties are requires
            optionals
        });
        for (const opt of optionals) {
            const child = someDevice.getChildByName(opt);
            const childName = child ? child.browseName.toString() : " ???";
            // xx console.log("opt ",opt,childName);
        }
        const instance_children = someDevice.findReferencesEx("Aggregates")
          .map((x: UAReference) => x.node!.browseName.name!.toString());

        // xx console.log(instance_children);

        ([] as string[]).concat(r1_child, r2_child).sort().should.eql(instance_children.sort());
    });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:71,代码来源:test_findReferenceEx.ts


示例10: warn

	public warn(message: string): void { // 実行を継続できるが改善すべき状況で使う
		this.log(chalk.yellow.bold('WARN'), chalk.yellow.bold(message));
	}
开发者ID:ha-dai,项目名称:Misskey,代码行数:3,代码来源:logger.ts



注:本文中的chalk.yellow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript chance.Chance函数代码示例发布时间:2022-05-24
下一篇:
TypeScript chalk.white类代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap