Package Exports
- lazy-url
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lazy-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
README
a more easy use URLyarn add lazy-urlsee index.test.ts
// @ts-ignore
import LazyURL from 'lazy-url';
let a1 = 'https://gitee.com/api/v5/';
let a2 = '/api/v5/repos/xxxx/xxxx/contents';
let u = new LazyURL(a2, a1);
console.dir(u.toRealString());
// => 'https://gitee.com/api/v5/repos/xxxx/xxxx/contents'
// @ts-ignore
u = new URL(a2, a1);
console.dir(u.toString());
// => 'https://gitee.com/api/v5/repos/xxxx/xxxx/contents'
a1 = '/api/v5/';
a2 = '/api/v5/repos/xxxx/xxxx/contents';
u = new LazyURL(a2, a1);
// => '/api/v5/repos/xxxx/xxxx/contents'
console.dir(u.toRealString());
// @ts-ignore
u = new URL(a2, a1);
// => throw error
console.dir(u.toString());