本文整理匯總了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
}