本文整理汇总了TypeScript中vs/base/common/network.URL类的典型用法代码示例。如果您正苦于以下问题:TypeScript URL类的具体用法?TypeScript URL怎么用?TypeScript URL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了URL类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: setup
setup(() => {
let event = new EventSource<any>();
oneModel = new model.Model('line1\nline2\nline3', null, URL.fromValue('file:///folder/file.txt'));
instantiation = create({
modelService: {
getModel: () => oneModel,
onModelAdded: event.value
},
requestService: {
getRequestUrl: () => 'file:///folder/file.txt'
},
contextService: new TestContextService()
});
});
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:15,代码来源:searchModel.test.ts
示例2: test
//.........这里部分代码省略.........
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '////test.js',
'http://www.test.com:8000/test.js'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '\\test.js?token=123',
'http://www.test.com:8000/test.js?token=123'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '\\test.js?query=foo#hash',
'http://www.test.com:8000/test.js?query=foo#hash'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '\\test.js#hash',
'http://www.test.com:8000/test.js#hash'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', 'test.js',
'http://www.test.com:8000/this/that/test.js'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '../test.js',
'http://www.test.com:8000/this/test.js'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '..\\test.js',
'http://www.test.com:8000/this/test.js'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '..\\test.js?token=123',
'http://www.test.com:8000/this/test.js?token=123'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '..\\test.js?query=foo#hash',
'http://www.test.com:8000/this/test.js?query=foo#hash'
);
assertCombine(
'http://www.test.com:8000/this/that/theother.html?query=foo#hash', '..\\test.js#hash',
'http://www.test.com:8000/this/test.js#hash'
);
assertCombine(
'http://www.test.com:8000/this/that/', 'test.js',
'http://www.test.com:8000/this/that/test.js'
);
assertCombine(
'http://www.test.com:8000/this/that/', './test.js',
'http://www.test.com:8000/this/that/test.js'
);
assertCombine(
'http://www.test.com:8000/', './test.js',
'http://www.test.com:8000/test.js'
);
assertCombine(
'http://www.test.com:8000/', './././test.js',
'http://www.test.com:8000/test.js'
);
assertCombine(
'http://www.test.com:8000', './././test.js',
'http://www.test.com:8000/test.js'
);
assertCombine(
'http://www.test.com:8000', 'test.js',
'http://www.test.com:8000/test.js'
);
assertCombine(
'http://www.test.com', '../test.js',
'http://www.test.com/test.js'
);
assertCombine(
'http://www.test.com', 'a/b/../../../test.js',
'http://www.test.com/test.js'
);
assertCombine(
'http://www.test.com/a/b', 'a/b/../../../../../test.js',
'http://www.test.com/test.js'
);
assertCombine(
'http://www.test.com', 'test.js',
'http://www.test.com/test.js'
);
assertCombine(
'http://www.test.com', 'a/b/test.js',
'http://www.test.com/a/b/test.js'
);
assertCombine(
'http://www.test.com', './a/b/test.js',
'http://www.test.com/a/b/test.js'
);
assertCombine(
'http://www.test.com/index.html', './a/b/test.js',
'http://www.test.com/a/b/test.js'
);
var url = new URL('inmemory://model/1#css');
assert.equal(url.toUnique(), 'inmemory://model/1');
});
开发者ID:ErickWendel,项目名称:vscode,代码行数:101,代码来源:network.test.ts
示例3: test
test('Bug 16793:# in folder name => mirror models get out of sync', function () {
var url = new URL('file:///C:/model/1#css');
assert.equal(deserialize(serialize(url)).toString(), url.toString());
});
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:4,代码来源:network.test.ts
注:本文中的vs/base/common/network.URL类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论