url-join-ts
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,2 +5,1 @@ export declare const DELIMITER_PATH = "/"; | ||
export declare const DELIMITER_SEARCH_VALUES = "="; | ||
export declare const URL_REGEX: RegExp; |
@@ -7,2 +7,1 @@ "use strict"; | ||
exports.DELIMITER_SEARCH_VALUES = '='; | ||
exports.URL_REGEX = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/; |
@@ -12,5 +12,4 @@ "use strict"; | ||
toString() { | ||
// check is url | ||
if (!constants_1.URL_REGEX.test(this.baseUrl)) { | ||
throw new TypeError('Url must be a valid url.'); | ||
if (!this.baseUrl) { | ||
throw new TypeError('Url must be not empty.'); | ||
} | ||
@@ -17,0 +16,0 @@ let resultUrl = [this.baseUrl, ...this.paths] |
{ | ||
"name": "url-join-ts", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Join urls and normalize", | ||
@@ -5,0 +5,0 @@ "author": "kvandake", |
Sorry, the diff of this file is not supported yet
187616
78