fix(core): update
This commit is contained in:
parent
5bb01a2db9
commit
d255c598b4
@ -24,9 +24,6 @@ tap.test('should parse an URL', async () => {
|
|||||||
|
|
||||||
tap.test('should parse an URL', async () => {
|
tap.test('should parse an URL', async () => {
|
||||||
const testUrl = 'https://lossless.com:3000/';
|
const testUrl = 'https://lossless.com:3000/';
|
||||||
// const urlMod = await import('url');
|
|
||||||
// const altParsed = urlMod.parse(testUrl);
|
|
||||||
// console.log(altParsed);
|
|
||||||
const parsedUrl = smarturl.Smarturl.createFromUrl(testUrl, {
|
const parsedUrl = smarturl.Smarturl.createFromUrl(testUrl, {
|
||||||
searchParams: {
|
searchParams: {
|
||||||
more: 'overwritten',
|
more: 'overwritten',
|
||||||
@ -36,4 +33,11 @@ tap.test('should parse an URL', async () => {
|
|||||||
console.log(parsedUrl.toString());
|
console.log(parsedUrl.toString());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should correctly parse ans assemble urls', async () => {
|
||||||
|
const testUrl = 'https://lossless.com/';
|
||||||
|
const parsedUrl = smarturl.Smarturl.createFromUrl(testUrl, {});
|
||||||
|
console.log(parsedUrl.toString());
|
||||||
|
expect(parsedUrl.toString()).toEqual('https://lossless.com:443/');
|
||||||
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smarturl',
|
name: '@pushrocks/smarturl',
|
||||||
version: '3.0.4',
|
version: '3.0.5',
|
||||||
description: 'a url parsing lib'
|
description: 'a url parsing lib'
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,6 @@ export class Smarturl implements IUrlObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return `${this.protocol}://${userpart}${this.hostname}:${this.port}/${this.path}`;
|
return `${this.protocol}//${userpart}${this.hostname}:${this.port}${this.path}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user