fix(core): update

This commit is contained in:
2022-08-06 22:17:41 +02:00
parent 1c503ec655
commit 60f1368071
6 changed files with 28 additions and 209 deletions

View File

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

View File

@ -27,7 +27,7 @@ export class Smarturl implements IUrlObject {
searchParams?: ISearchParams;
}
): Smarturl {
const parsedUrlInstance = plugins.url(urlArg);
const parsedUrlInstance = new URL(urlArg);
const searchParams: ISearchParams = {};
// enrichment
@ -73,12 +73,12 @@ export class Smarturl implements IUrlObject {
const parsedUrl: IUrlObject = {
href: parsedUrlInstance.href,
origin: `${parsedUrlInstance.protocol}://${parsedUrlInstance.resource}`,
origin: parsedUrlInstance.origin,
protocol: parsedUrlInstance.protocol,
username: parsedUrlInstance.user.split(':')[0],
password: parsedUrlInstance.user.split(':')[1] || '',
host: `${parsedUrlInstance.resource}:${parsedUrlInstance.port}`,
hostname: parsedUrlInstance.resource,
username: parsedUrlInstance.username,
password: parsedUrlInstance.password,
host: parsedUrlInstance.host,
hostname: parsedUrlInstance.hostname,
port: parsedUrlInstance.port,
path,
pathname: parsedUrlInstance.pathname,

View File

@ -1,4 +1 @@
// node native
import { default as url } from 'parse-url';
export { url };
export {};