当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.isWebUri方法代码示例

本文整理汇总了TypeScript中@0xproject/assert.assert.isWebUri方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.isWebUri方法的具体用法?TypeScript assert.isWebUri怎么用?TypeScript assert.isWebUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@0xproject/assert.assert的用法示例。


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

示例1: catch

        demandOption: false,
    })
    .option('export-environment', {
        alias: ['ee'],
        describe: 'The relative path to write the postman environment file used by the collection run',
        type: 'string',
        normalize: true,
        demandOption: false,
    })
    .example(
        "$0 --endpoint-url 'http://api.example.com' --out 'path/to/report.json' --network-id 42 --environment 'path/to/custom/environment.json' --export-collection 'path/to/collection.json' --export-environment 'path/to/environment.json'",
        'Full usage example',
    ).argv;
// perform extra validation on command line arguments
try {
    assert.isWebUri('args', args.endpointUrl);
} catch (err) {
    logUtils.log(`${chalk.red(`Invalid url format:`)} ${args.endpointUrl}`);
    process.exit(1);
}
if (!_.includes(SUPPORTED_NETWORK_IDS, args.networkId)) {
    logUtils.log(`${chalk.red(`Unsupported network id:`)} ${args.networkId}`);
    logUtils.log(`${chalk.bold(`Supported network ids:`)} ${SUPPORTED_NETWORK_IDS}`);
    process.exit(1);
}
const mainAsync = async () => {
    const newmanReporterOptions = !_.isUndefined(args.output)
        ? {
              reporters: 'json',
              reporter: {
                  json: {
开发者ID:ewingrj,项目名称:0x-monorepo,代码行数:31,代码来源:index.ts

示例2: constructor

 /**
  * Instantiates a new HttpClient instance
  * @param   url    The relayer API base HTTP url you would like to interact with
  * @return  An instance of HttpClient
  */
 constructor(url: string) {
     assert.isWebUri('url', url);
     this._apiEndpointUrl = url.replace(TRAILING_SLASHES_REGEX, ''); // remove trailing slashes
 }
开发者ID:ewingrj,项目名称:0x-monorepo,代码行数:9,代码来源:http_client.ts


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