@jsenv/urls 2.5.4 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/main.js +1 -0
- package/src/url_utils.js +8 -0
package/package.json
CHANGED
package/src/main.js
CHANGED
package/src/url_utils.js
CHANGED
|
@@ -23,6 +23,14 @@ export const isValidUrl = (url) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
export const asSpecifierWithoutSearch = (specifier) => {
|
|
27
|
+
if (isValidUrl(specifier)) {
|
|
28
|
+
return asUrlWithoutSearch(specifier);
|
|
29
|
+
}
|
|
30
|
+
const [beforeQuestion] = specifier.split("?");
|
|
31
|
+
return beforeQuestion;
|
|
32
|
+
};
|
|
33
|
+
|
|
26
34
|
// normalize url search params:
|
|
27
35
|
// Using URLSearchParams to alter the url search params
|
|
28
36
|
// can result into "file:///file.css?css_module"
|