trousse 2.16.1 → 2.16.3
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/dist/is.js +1 -1
- package/dist/urls.js +1 -1
- package/package.json +2 -2
package/dist/is.js
CHANGED
|
@@ -25,7 +25,7 @@ const isPlainObject = (value) => {
|
|
|
25
25
|
};
|
|
26
26
|
const whitespaceOnlyRegex = /^\p{White_Space}*$/u;
|
|
27
27
|
const isNonEmptyString = (value) => {
|
|
28
|
-
if (!isString(value) || value
|
|
28
|
+
if (!isString(value) || !value) return false;
|
|
29
29
|
const code = value.charCodeAt(0);
|
|
30
30
|
if (code > 32 && code < 127) return true;
|
|
31
31
|
return !whitespaceOnlyRegex.test(value);
|
package/dist/urls.js
CHANGED
|
@@ -378,7 +378,7 @@ const normalizeUrl = (url, options) => {
|
|
|
378
378
|
parsed.search = pairs.join("&");
|
|
379
379
|
}
|
|
380
380
|
if (options.sortQueryParams && parsed.search.includes("&")) parsed.search = parsed.search.slice(1).split("&").filter(Boolean).sort(compareQueryPairs).join("&");
|
|
381
|
-
if (options.stripEmptyQuery && parsed.search
|
|
381
|
+
if (options.stripEmptyQuery && !parsed.search) parsed.search = "";
|
|
382
382
|
let result = parsed.href;
|
|
383
383
|
if (options.stripRootSlash && result === `${parsed.origin}/`) result = parsed.origin;
|
|
384
384
|
if (options.stripScheme ?? options.stripProtocol) result = result.replace(schemePrefixRegex, "");
|
package/package.json
CHANGED