本文整理匯總了TypeScript中polymer-analyzer.FsUrlResolver.resolve方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FsUrlResolver.resolve方法的具體用法?TypeScript FsUrlResolver.resolve怎麽用?TypeScript FsUrlResolver.resolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類polymer-analyzer.FsUrlResolver
的用法示例。
在下文中一共展示了FsUrlResolver.resolve方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('with a base tag and absolute true', () => {
const url = 'index.html' as PackageRelativeUrl;
const expected =
('<html><base href="/base/">' +
'<link rel="prefetch" href="bower_components/polymer/polymer.html">' +
'<link rel="prefetch" href="src/my-icons.html">' +
'<body>foo</body></html>');
const actual = createLinks(
urlResolver, htmlWithBase, urlResolver.resolve(url)!, deps, true);
assert.equal(actual, expected);
});
示例2:
urlMapper: (bundles: Bundle[]) => {
const map = new Map<ResolvedUrl, Bundle>();
for (const bundle of bundles) {
map.set(
urlResolver.resolve(
`bundled/${
[...bundle.entrypoints]
.map((u) => urlResolver.relative(u))
.join()}` as PackageRelativeUrl)!,
bundle);
}
return map;
}
示例3:
].map((u) => urlResolver.resolve(u as PackageRelativeUrl)!));
示例4:
.map((redirect: string) => {
const [prefix, path] = redirect.split('|');
const resolvedPrefix = urlResolver.resolve(prefix as any);
return {prefix: resolvedPrefix, path};
})
示例5:
].map((u: any) => urlResolver.resolve(u)!));