本文整理汇总了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: {
示例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
}