fix(core): update

This commit is contained in:
Philipp Kunz 2022-08-21 13:56:34 +02:00
parent 5bb01a2db9
commit d255c598b4
3 changed files with 9 additions and 5 deletions

View File

@ -24,9 +24,6 @@ tap.test('should parse an URL', async () => {
tap.test('should parse an URL', async () => {
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, {
searchParams: {
more: 'overwritten',
@ -36,4 +33,11 @@ tap.test('should parse an URL', async () => {
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();

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smarturl',
version: '3.0.4',
version: '3.0.5',
description: 'a url parsing lib'
}

View File

@ -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}`;
}
}