本文整理汇总了TypeScript中vs/base/common/network.ParsedUrl类的典型用法代码示例。如果您正苦于以下问题:TypeScript ParsedUrl类的具体用法?TypeScript ParsedUrl怎么用?TypeScript ParsedUrl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParsedUrl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: assertUrl
function assertUrl(raw:string, scheme:string, domain:string, port:string, path:string, queryString:string, fragmentId:string): void {
var url = new ParsedUrl(raw);
assert.equal(url.getScheme(), scheme, 'getScheme ok for ' + raw);
var protocol = scheme ? scheme + ':' : scheme;
assert.equal(url.getProtocol(), protocol, 'getProtocol ok for ' + raw);
assert.equal(url.getDomain(), domain, 'getDomain ok for ' + raw);
assert.equal(url.getPort(), port, 'getPort ok for ' + raw);
var host = domain + (port ? ':' + port : '');
assert.equal(url.getHost(), host, 'getHost ok for ' + raw);
assert.equal(url.getPath(), path, 'getPath ok for ' + raw);
assert.equal(url.getQueryString(), queryString, 'getQueryString ok for ' + raw);
assert.equal(url.getFragmentId(), fragmentId, 'getFragmentId ok for ' + raw);
}
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:13,代码来源:network.test.ts
示例2: assertUrl
function assertUrl(raw:string, scheme:string, domain:string, port:string, path:string, queryString:string, fragmentId:string): void {
var url = new ParsedUrl(raw);
assert.equal(url.getScheme(), scheme, 'getScheme ok for ' + raw);
var protocol = scheme ? scheme + ':' : scheme;
assert.equal(url.getProtocol(), protocol, 'getProtocol ok for ' + raw);
assert.equal(url.getDomain(), domain, 'getDomain ok for ' + raw);
assert.equal(url.getPort(), port, 'getPort ok for ' + raw);
var host = domain + (port ? ':' + port : '');
assert.equal(url.getHost(), host, 'getHost ok for ' + raw);
assert.equal(url.getPath(), path, 'getPath ok for ' + raw);
assert.equal(url.getQueryString(), queryString, 'getQueryString ok for ' + raw);
assert.equal(url.getFragmentId(), fragmentId, 'getFragmentId ok for ' + raw);
// check for equivalent behaviour
var uri = URI.parse(raw);
assert.equal(uri.scheme, scheme);
assert.equal(uri.authority, port ? domain + ':' + port : domain);
assert.equal(uri.path, path);
assert.equal(uri.query, queryString);
assert.equal(uri.fragment, fragmentId);
}
开发者ID:ErickWendel,项目名称:vscode,代码行数:21,代码来源:network.test.ts
示例3: assertCombine
function assertCombine(base:string, relativeUrl:string, expectedUrl:string): void {
var url = new ParsedUrl(base);
var result = url.combine(relativeUrl);
assert.equal(result, expectedUrl, 'combine ok for ' + base + ' and ' + relativeUrl);
}
开发者ID:ErickWendel,项目名称:vscode,代码行数:5,代码来源:network.test.ts
注:本文中的vs/base/common/network.ParsedUrl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论