@rzl-zone/utils-js 3.11.1 → 3.12.1-beta.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/{LICENSE.md → LICENSE} +3 -3
- package/README.md +62 -89
- package/dist/.references/index.d.cts +25 -0
- package/dist/.references/index.d.ts +25 -0
- package/dist/assertIsArray-BChqwPiP.cjs +26 -0
- package/dist/assertIsArray-BChqwPiP.cjs.map +1 -0
- package/dist/assertIsArray-BfAbIUfa.js +20 -0
- package/dist/assertIsArray-BfAbIUfa.js.map +1 -0
- package/dist/assertIsBoolean-BlBct0Fc.js +1073 -0
- package/dist/assertIsBoolean-BlBct0Fc.js.map +1 -0
- package/dist/assertIsBoolean-DozdtbNi.cjs +1283 -0
- package/dist/assertIsBoolean-DozdtbNi.cjs.map +1 -0
- package/dist/assertIsString-Bvk7bUL7.cjs +26 -0
- package/dist/assertIsString-Bvk7bUL7.cjs.map +1 -0
- package/dist/assertIsString-DqV9NwbI.js +20 -0
- package/dist/assertIsString-DqV9NwbI.js.map +1 -0
- package/dist/assertions/index.cjs +37 -40
- package/dist/assertions/index.cjs.map +1 -0
- package/dist/assertions/index.d.cts +12 -0
- package/dist/assertions/index.d.ts +10 -824
- package/dist/assertions/index.js +30 -13
- package/dist/assertions/index.js.map +1 -0
- package/dist/conversions/index.cjs +34 -103
- package/dist/conversions/index.d.cts +12 -0
- package/dist/conversions/index.d.ts +10 -1791
- package/dist/conversions/index.js +14 -24
- package/dist/conversions-CBs8-REq.cjs +448 -0
- package/dist/conversions-CBs8-REq.cjs.map +1 -0
- package/dist/conversions-EMJa3g-D.js +382 -0
- package/dist/conversions-EMJa3g-D.js.map +1 -0
- package/dist/events/index.cjs +55 -31
- package/dist/events/index.cjs.map +1 -0
- package/dist/events/index.d.cts +174 -0
- package/dist/events/index.d.ts +31 -35
- package/dist/events/index.js +50 -12
- package/dist/events/index.js.map +1 -0
- package/dist/formatEnvPort-DpIXzPAZ.js +159 -0
- package/dist/formatEnvPort-DpIXzPAZ.js.map +1 -0
- package/dist/formatEnvPort-hHNvOim-.cjs +171 -0
- package/dist/formatEnvPort-hHNvOim-.cjs.map +1 -0
- package/dist/formatters/index.cjs +21 -61
- package/dist/formatters/index.d.cts +12 -0
- package/dist/formatters/index.d.ts +10 -2152
- package/dist/formatters/index.js +10 -18
- package/dist/formatters-QcZO_Cpx.js +367 -0
- package/dist/formatters-QcZO_Cpx.js.map +1 -0
- package/dist/formatters-lAYgA11L.cjs +427 -0
- package/dist/formatters-lAYgA11L.cjs.map +1 -0
- package/dist/generators/index.cjs +161 -41
- package/dist/generators/index.cjs.map +1 -0
- package/dist/generators/index.d.cts +12 -0
- package/dist/generators/index.d.ts +10 -338
- package/dist/generators/index.js +154 -14
- package/dist/generators/index.js.map +1 -0
- package/dist/index-26W7ItWx.d.ts +760 -0
- package/dist/index-BPPQjAfs.d.cts +2359 -0
- package/dist/index-BXjlgBLz.d.cts +2139 -0
- package/dist/index-B_Wwo91H.d.ts +2359 -0
- package/dist/index-CpufydcI.d.cts +704 -0
- package/dist/index-Czc4O526.d.ts +333 -0
- package/dist/index-DPs1_p5G.d.cts +760 -0
- package/dist/index-DRpOyBSC.d.ts +1703 -0
- package/dist/index-DWWvtHUn.d.cts +822 -0
- package/dist/index-DnM0LD0n.d.cts +333 -0
- package/dist/index-GUZ9fK6T.d.ts +2139 -0
- package/dist/index-I4fAzwXV.d.ts +704 -0
- package/dist/index-JDrOl_19.d.ts +822 -0
- package/dist/index-b66P49Qe.d.cts +1703 -0
- package/dist/isBigInt-B1cijjqm.cjs +20 -0
- package/dist/isBigInt-B1cijjqm.cjs.map +1 -0
- package/dist/isBigInt-C0bN0Rhu.js +14 -0
- package/dist/isBigInt-C0bN0Rhu.js.map +1 -0
- package/dist/isEmptyObject-DI42NEo0.cjs +37 -0
- package/dist/isEmptyObject-DI42NEo0.cjs.map +1 -0
- package/dist/isEmptyObject-DeLVIJpl.js +25 -0
- package/dist/isEmptyObject-DeLVIJpl.js.map +1 -0
- package/dist/isEmptyString-BTUWYTbw.js +15 -0
- package/dist/isEmptyString-BTUWYTbw.js.map +1 -0
- package/dist/isEmptyString-CCK3bP74.cjs +21 -0
- package/dist/isEmptyString-CCK3bP74.cjs.map +1 -0
- package/dist/isEmptyValue-DMSMFTU8.cjs +30 -0
- package/dist/isEmptyValue-DMSMFTU8.cjs.map +1 -0
- package/dist/isEmptyValue-fjnfQnt5.js +24 -0
- package/dist/isEmptyValue-fjnfQnt5.js.map +1 -0
- package/dist/isEqual-B1fRgEuU.cjs +111 -0
- package/dist/isEqual-B1fRgEuU.cjs.map +1 -0
- package/dist/isEqual-DhyP8fB_.js +87 -0
- package/dist/isEqual-DhyP8fB_.js.map +1 -0
- package/dist/isFinite-BYMOo0os.js +15 -0
- package/dist/isFinite-BYMOo0os.js.map +1 -0
- package/dist/isFinite-sFkps2TY.cjs +21 -0
- package/dist/isFinite-sFkps2TY.cjs.map +1 -0
- package/dist/isInteger-DS9V7l_f.js +14 -0
- package/dist/isInteger-DS9V7l_f.js.map +1 -0
- package/dist/isInteger-FTCthMre.cjs +20 -0
- package/dist/isInteger-FTCthMre.cjs.map +1 -0
- package/dist/isPlainObject-DcFGh3_5.d.ts +530 -0
- package/dist/isPlainObject-doTI11Ib.d.cts +530 -0
- package/dist/isServer-D1TXfOs3.js +14 -0
- package/dist/isServer-D1TXfOs3.js.map +1 -0
- package/dist/isServer-q-QLFCqE.cjs +20 -0
- package/dist/isServer-q-QLFCqE.cjs.map +1 -0
- package/dist/isTypedArray-47R0wdrc.js +31 -0
- package/dist/isTypedArray-47R0wdrc.js.map +1 -0
- package/dist/isTypedArray-DiCoqffZ.cjs +43 -0
- package/dist/isTypedArray-DiCoqffZ.cjs.map +1 -0
- package/dist/isURL-CQiowFq2.js +14 -0
- package/dist/isURL-CQiowFq2.js.map +1 -0
- package/dist/isURL-WZypXsax.cjs +20 -0
- package/dist/isURL-WZypXsax.cjs.map +1 -0
- package/dist/isValidDomain-BSXshgkC.cjs +1788 -0
- package/dist/isValidDomain-BSXshgkC.cjs.map +1 -0
- package/dist/isValidDomain-DwA2EN79.js +1782 -0
- package/dist/isValidDomain-DwA2EN79.js.map +1 -0
- package/dist/next/index.cjs +119 -212
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +226 -0
- package/dist/next/index.d.ts +26 -31
- package/dist/next/index.js +117 -210
- package/dist/next/index.js.map +1 -0
- package/dist/next/server/index.cjs +25 -40
- package/dist/next/server/index.cjs.map +1 -0
- package/dist/next/server/index.d.cts +39 -0
- package/dist/next/server/index.d.ts +9 -10
- package/dist/next/server/index.js +23 -38
- package/dist/next/server/index.js.map +1 -0
- package/dist/noop-B2mTBhW-.cjs +18 -0
- package/dist/noop-B2mTBhW-.cjs.map +1 -0
- package/dist/noop-BzktGBVz.js +12 -0
- package/dist/noop-BzktGBVz.js.map +1 -0
- package/dist/normalizeSpaces-DQHR3Tlr.cjs +29 -0
- package/dist/normalizeSpaces-DQHR3Tlr.cjs.map +1 -0
- package/dist/normalizeSpaces-WS_iERJk.js +23 -0
- package/dist/normalizeSpaces-WS_iERJk.js.map +1 -0
- package/dist/normalizeString-2WLth_Gj.js +15 -0
- package/dist/normalizeString-2WLth_Gj.js.map +1 -0
- package/dist/normalizeString-D8euBcRD.cjs +21 -0
- package/dist/normalizeString-D8euBcRD.cjs.map +1 -0
- package/dist/operations/index.cjs +65 -32
- package/dist/operations/index.cjs.map +1 -0
- package/dist/operations/index.d.cts +139 -0
- package/dist/operations/index.d.ts +10 -15
- package/dist/operations/index.js +61 -17
- package/dist/operations/index.js.map +1 -0
- package/dist/parsers/index.cjs +12 -19
- package/dist/parsers/index.d.cts +239 -0
- package/dist/parsers/index.d.ts +71 -72
- package/dist/parsers/index.js +10 -12
- package/dist/parsers-DXtpsDyj.cjs +649 -0
- package/dist/parsers-DXtpsDyj.cjs.map +1 -0
- package/dist/parsers-Dpuq-V4u.js +643 -0
- package/dist/parsers-Dpuq-V4u.js.map +1 -0
- package/dist/parsing-B43x1sxn.js +50 -0
- package/dist/parsing-B43x1sxn.js.map +1 -0
- package/dist/parsing-lRoxn1Nz.cjs +56 -0
- package/dist/parsing-lRoxn1Nz.cjs.map +1 -0
- package/dist/predicates/index.cjs +91 -296
- package/dist/predicates/index.d.cts +13 -0
- package/dist/predicates/index.d.ts +12 -2482
- package/dist/predicates/index.js +23 -25
- package/dist/predicates-DiaYA7Ps.cjs +413 -0
- package/dist/predicates-DiaYA7Ps.cjs.map +1 -0
- package/dist/predicates-gNepszvo.js +257 -0
- package/dist/predicates-gNepszvo.js.map +1 -0
- package/dist/promises/index.cjs +76 -24
- package/dist/promises/index.cjs.map +1 -0
- package/dist/promises/index.d.cts +123 -0
- package/dist/promises/index.d.ts +28 -31
- package/dist/promises/index.js +73 -13
- package/dist/promises/index.js.map +1 -0
- package/dist/punyCode-CTWXVVFo.cjs +185 -0
- package/dist/punyCode-CTWXVVFo.cjs.map +1 -0
- package/dist/punyCode-hmiFzLWT.js +179 -0
- package/dist/punyCode-hmiFzLWT.js.map +1 -0
- package/dist/removeSpaces-BE8lfh-4.js +19 -0
- package/dist/removeSpaces-BE8lfh-4.js.map +1 -0
- package/dist/removeSpaces-DRRxNWlb.cjs +25 -0
- package/dist/removeSpaces-DRRxNWlb.cjs.map +1 -0
- package/dist/safeJsonParse-BBnQElk8.cjs +208 -0
- package/dist/safeJsonParse-BBnQElk8.cjs.map +1 -0
- package/dist/safeJsonParse-CXruaP0p.js +184 -0
- package/dist/safeJsonParse-CXruaP0p.js.map +1 -0
- package/dist/safeStableStringify-BNh3D0K0.js +88 -0
- package/dist/safeStableStringify-BNh3D0K0.js.map +1 -0
- package/dist/safeStableStringify-Cc62pfRp.cjs +106 -0
- package/dist/safeStableStringify-Cc62pfRp.cjs.map +1 -0
- package/dist/strings/index.cjs +76 -81
- package/dist/strings/index.cjs.map +1 -0
- package/dist/strings/index.d.cts +12 -0
- package/dist/strings/index.d.ts +10 -775
- package/dist/strings/index.js +59 -14
- package/dist/strings/index.js.map +1 -0
- package/dist/tailwind/index.cjs +19 -47
- package/dist/tailwind/index.d.cts +12 -0
- package/dist/tailwind/index.d.ts +11 -712
- package/dist/tailwind/index.js +10 -12
- package/dist/tailwind-DJ4cmLUw.cjs +247 -0
- package/dist/tailwind-DJ4cmLUw.cjs.map +1 -0
- package/dist/tailwind-IJvOdkZp.js +199 -0
- package/dist/tailwind-IJvOdkZp.js.map +1 -0
- package/dist/toStringArrayUnRecursive-CFs0jTEg.js +39 -0
- package/dist/toStringArrayUnRecursive-CFs0jTEg.js.map +1 -0
- package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs +51 -0
- package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs.map +1 -0
- package/dist/urls/index.cjs +129 -57
- package/dist/urls/index.cjs.map +1 -0
- package/dist/urls/index.d.cts +740 -0
- package/dist/urls/index.d.ts +218 -224
- package/dist/urls/index.js +121 -26
- package/dist/urls/index.js.map +1 -0
- package/package.json +203 -194
- package/dist/chunk-22V4WP3H.js +0 -53
- package/dist/chunk-2XSZ2ANI.js +0 -63
- package/dist/chunk-3T6VSWYX.js +0 -21
- package/dist/chunk-5WIEDF2J.js +0 -1823
- package/dist/chunk-6EDFZJZ5.cjs +0 -598
- package/dist/chunk-6LXWT2I5.js +0 -32
- package/dist/chunk-6YGBRENU.js +0 -209
- package/dist/chunk-7FGNVDEV.cjs +0 -38
- package/dist/chunk-AXDYWO67.js +0 -119
- package/dist/chunk-B6PMNZ4M.cjs +0 -35
- package/dist/chunk-BAV5T2E3.cjs +0 -15
- package/dist/chunk-BLF7SD66.js +0 -95
- package/dist/chunk-BMZZXZJ2.cjs +0 -30
- package/dist/chunk-BOYP3ARU.js +0 -264
- package/dist/chunk-BPYW5YL7.js +0 -16
- package/dist/chunk-C2PV3VWC.cjs +0 -118
- package/dist/chunk-CCJ2MSN7.js +0 -16
- package/dist/chunk-DAPAK2W3.cjs +0 -123
- package/dist/chunk-DLS3G6WQ.cjs +0 -23
- package/dist/chunk-DNMCR5JH.js +0 -370
- package/dist/chunk-DVMHRLKP.cjs +0 -16
- package/dist/chunk-EBYFYZW4.cjs +0 -26
- package/dist/chunk-ENMRZ4BE.js +0 -302
- package/dist/chunk-FJ4BQFVO.js +0 -587
- package/dist/chunk-GIKL4PUF.cjs +0 -106
- package/dist/chunk-GOFINGT6.js +0 -35
- package/dist/chunk-GXKQ3LHF.js +0 -101
- package/dist/chunk-HNBRGN4R.js +0 -24
- package/dist/chunk-HYN6FC5A.cjs +0 -249
- package/dist/chunk-IZGVBYFN.js +0 -242
- package/dist/chunk-JIE447J5.js +0 -676
- package/dist/chunk-JXEIJM5M.cjs +0 -237
- package/dist/chunk-K47GZDBH.js +0 -115
- package/dist/chunk-K5536YHG.cjs +0 -269
- package/dist/chunk-KHO2SBNA.cjs +0 -16
- package/dist/chunk-KXJ7X325.cjs +0 -308
- package/dist/chunk-L5RDAVVH.js +0 -14
- package/dist/chunk-LJHPTLWB.js +0 -109
- package/dist/chunk-M7ELWZXM.cjs +0 -1825
- package/dist/chunk-MSUW5VHZ.js +0 -1590
- package/dist/chunk-MUHRPRR7.cjs +0 -65
- package/dist/chunk-MV3TSQSH.cjs +0 -397
- package/dist/chunk-NLZLXWAU.cjs +0 -678
- package/dist/chunk-NVRZPF5M.cjs +0 -18
- package/dist/chunk-ONZFBJVW.js +0 -14
- package/dist/chunk-PGNL7JXO.cjs +0 -251
- package/dist/chunk-Q4GEQS7X.cjs +0 -564
- package/dist/chunk-QNKGP5DY.js +0 -14
- package/dist/chunk-QYI2VJLS.cjs +0 -211
- package/dist/chunk-RBWZII5I.js +0 -59
- package/dist/chunk-RMP7VMPB.cjs +0 -33
- package/dist/chunk-RZOGBYIS.js +0 -21
- package/dist/chunk-SU3UELUB.cjs +0 -36
- package/dist/chunk-SYHPSOUU.cjs +0 -1626
- package/dist/chunk-SZUNAEMR.js +0 -246
- package/dist/chunk-TER22LO4.cjs +0 -64
- package/dist/chunk-TJHGRQ4P.js +0 -33
- package/dist/chunk-U23I7JPB.cjs +0 -56
- package/dist/chunk-U7HHN47R.js +0 -552
- package/dist/chunk-UDA26MCU.cjs +0 -16
- package/dist/chunk-UIAWUZ4H.js +0 -31
- package/dist/chunk-ULQPCIA2.js +0 -16
- package/dist/chunk-VJDDGRIK.cjs +0 -16
- package/dist/chunk-WETQI6HM.js +0 -232
- package/dist/chunk-WLOQQFDS.cjs +0 -18
- package/dist/chunk-WVSPXFTY.js +0 -14
- package/dist/chunk-WXFTVXBF.cjs +0 -23
- package/dist/chunk-XPVTIGU2.cjs +0 -113
- package/dist/chunk-XX6RUGTM.cjs +0 -18
- package/dist/chunk-YWHHVDT4.js +0 -13
- package/dist/chunk-ZPDMWDGZ.cjs +0 -101
- package/dist/chunk-ZVWZEGQP.js +0 -28
- package/dist/index.d.ts +0 -24
- package/dist/isPlainObject-0p3VveWr.d.ts +0 -534
- package/dist/rzl-utils.global.js +0 -10
package/dist/chunk-6YGBRENU.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
import { assertIsString } from './chunk-3T6VSWYX.js';
|
|
11
|
-
import { getPreciseType } from './chunk-MSUW5VHZ.js';
|
|
12
|
-
|
|
13
|
-
var maxInt = 2147483647;
|
|
14
|
-
var base = 36;
|
|
15
|
-
var tMin = 1;
|
|
16
|
-
var tMax = 26;
|
|
17
|
-
var skew = 38;
|
|
18
|
-
var damp = 700;
|
|
19
|
-
var initialBias = 72;
|
|
20
|
-
var initialN = 128;
|
|
21
|
-
var delimiter = "-";
|
|
22
|
-
var regexPunycode = /^xn--/;
|
|
23
|
-
var regexNonASCII = /[^\0-\x7F]/;
|
|
24
|
-
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
|
|
25
|
-
var errors = {
|
|
26
|
-
overflow: "Overflow: input needs wider integers to process",
|
|
27
|
-
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
28
|
-
"invalid-input": "Invalid input"
|
|
29
|
-
};
|
|
30
|
-
var floor = Math.floor;
|
|
31
|
-
var stringFromCharCode = String.fromCharCode;
|
|
32
|
-
function error(type) {
|
|
33
|
-
throw new RangeError(errors[type]);
|
|
34
|
-
}
|
|
35
|
-
function map(array, fn) {
|
|
36
|
-
const result = [];
|
|
37
|
-
let length = array.length;
|
|
38
|
-
while (length--) result[length] = fn(array[length]);
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
function mapDomain(domain, fn) {
|
|
42
|
-
const parts = domain.split("@");
|
|
43
|
-
let result = "";
|
|
44
|
-
if (parts.length > 1) {
|
|
45
|
-
result = parts[0] + "@";
|
|
46
|
-
domain = parts[1];
|
|
47
|
-
}
|
|
48
|
-
domain = domain.replace(regexSeparators, ".");
|
|
49
|
-
const labels = domain.split(".");
|
|
50
|
-
return result + map(labels, fn).join(".");
|
|
51
|
-
}
|
|
52
|
-
function ucs2decode(input) {
|
|
53
|
-
assertIsString(input, {
|
|
54
|
-
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.ucs2.decode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
55
|
-
});
|
|
56
|
-
const output = [];
|
|
57
|
-
let counter = 0;
|
|
58
|
-
const length = input.length;
|
|
59
|
-
while (counter < length) {
|
|
60
|
-
const value = input.charCodeAt(counter++);
|
|
61
|
-
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
62
|
-
const extra = input.charCodeAt(counter++);
|
|
63
|
-
if ((extra & 64512) === 56320)
|
|
64
|
-
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
65
|
-
else {
|
|
66
|
-
output.push(value);
|
|
67
|
-
counter--;
|
|
68
|
-
}
|
|
69
|
-
} else output.push(value);
|
|
70
|
-
}
|
|
71
|
-
return output;
|
|
72
|
-
}
|
|
73
|
-
var ucs2encode = (points) => {
|
|
74
|
-
if (!Array.isArray(points) || !points.every((p) => typeof p === "number" && Number.isFinite(p))) {
|
|
75
|
-
throw new TypeError(
|
|
76
|
-
`Utils \`punycodeUtilsJS.ucs2.encode\`, parameter \`points\` must be an array of numbers, but received: \`${getPreciseType(
|
|
77
|
-
points
|
|
78
|
-
)}\`.`
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
return String.fromCodePoint(...points);
|
|
82
|
-
};
|
|
83
|
-
function basicToDigit(codePoint) {
|
|
84
|
-
if (codePoint >= 48 && codePoint < 58) return 26 + (codePoint - 48);
|
|
85
|
-
if (codePoint >= 65 && codePoint < 91) return codePoint - 65;
|
|
86
|
-
if (codePoint >= 97 && codePoint < 123) return codePoint - 97;
|
|
87
|
-
return base;
|
|
88
|
-
}
|
|
89
|
-
function digitToBasic(digit, flag) {
|
|
90
|
-
return digit + 22 + 75 * (digit < 26 ? 1 : 0) - Number(flag !== 0) * 32;
|
|
91
|
-
}
|
|
92
|
-
function adapt(delta, numPoints, firstTime) {
|
|
93
|
-
let k = 0;
|
|
94
|
-
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
95
|
-
delta += floor(delta / numPoints);
|
|
96
|
-
while (delta > (base - tMin) * tMax >> 1) {
|
|
97
|
-
delta = floor(delta / (base - tMin));
|
|
98
|
-
k += base;
|
|
99
|
-
}
|
|
100
|
-
return floor(k + (base - tMin + 1) * delta / (delta + skew));
|
|
101
|
-
}
|
|
102
|
-
function decode(input) {
|
|
103
|
-
assertIsString(input, {
|
|
104
|
-
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.decode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
105
|
-
});
|
|
106
|
-
const output = [];
|
|
107
|
-
const inputLength = input.length;
|
|
108
|
-
let i = 0, n = initialN, bias = initialBias;
|
|
109
|
-
let basic = input.lastIndexOf(delimiter);
|
|
110
|
-
if (basic < 0) basic = 0;
|
|
111
|
-
for (let j = 0; j < basic; j++) {
|
|
112
|
-
if (input.charCodeAt(j) >= 128) error("not-basic");
|
|
113
|
-
output.push(input.charCodeAt(j));
|
|
114
|
-
}
|
|
115
|
-
for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
116
|
-
const oldi = i;
|
|
117
|
-
let w = 1;
|
|
118
|
-
for (let k = base; ; k += base) {
|
|
119
|
-
if (index >= inputLength) error("invalid-input");
|
|
120
|
-
const digit = basicToDigit(input.charCodeAt(index++));
|
|
121
|
-
if (digit >= base) error("invalid-input");
|
|
122
|
-
if (digit > floor((maxInt - i) / w)) error("overflow");
|
|
123
|
-
i += digit * w;
|
|
124
|
-
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
125
|
-
if (digit < t) break;
|
|
126
|
-
const baseMinusT = base - t;
|
|
127
|
-
if (w > floor(maxInt / baseMinusT)) error("overflow");
|
|
128
|
-
w *= baseMinusT;
|
|
129
|
-
}
|
|
130
|
-
const out = output.length + 1;
|
|
131
|
-
bias = adapt(i - oldi, out, oldi === 0);
|
|
132
|
-
if (floor(i / out) > maxInt - n) error("overflow");
|
|
133
|
-
n += floor(i / out);
|
|
134
|
-
i %= out;
|
|
135
|
-
output.splice(i++, 0, n);
|
|
136
|
-
}
|
|
137
|
-
return String.fromCodePoint(...output);
|
|
138
|
-
}
|
|
139
|
-
function encode(input) {
|
|
140
|
-
assertIsString(input, {
|
|
141
|
-
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.encode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
142
|
-
});
|
|
143
|
-
const output = [];
|
|
144
|
-
const points = ucs2decode(input);
|
|
145
|
-
const inputLength = points.length;
|
|
146
|
-
let n = initialN, delta = 0, bias = initialBias;
|
|
147
|
-
for (const cp of points) if (cp < 128) output.push(stringFromCharCode(cp));
|
|
148
|
-
const basicLength = output.length;
|
|
149
|
-
let handledCPCount = basicLength;
|
|
150
|
-
if (basicLength) output.push(delimiter);
|
|
151
|
-
while (handledCPCount < inputLength) {
|
|
152
|
-
let m = maxInt;
|
|
153
|
-
for (const cp of points) if (cp >= n && cp < m) m = cp;
|
|
154
|
-
const handledCPCountPlusOne = handledCPCount + 1;
|
|
155
|
-
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) error("overflow");
|
|
156
|
-
delta += (m - n) * handledCPCountPlusOne;
|
|
157
|
-
n = m;
|
|
158
|
-
for (const cp of points) {
|
|
159
|
-
if (cp < n) delta++;
|
|
160
|
-
if (cp === n) {
|
|
161
|
-
let q = delta;
|
|
162
|
-
for (let k = base; ; k += base) {
|
|
163
|
-
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
164
|
-
if (q < t) break;
|
|
165
|
-
output.push(stringFromCharCode(digitToBasic(t + (q - t) % (base - t), 0)));
|
|
166
|
-
q = floor((q - t) / (base - t));
|
|
167
|
-
}
|
|
168
|
-
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
169
|
-
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
|
|
170
|
-
delta = 0;
|
|
171
|
-
handledCPCount++;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
delta++;
|
|
175
|
-
n++;
|
|
176
|
-
}
|
|
177
|
-
return output.join("");
|
|
178
|
-
}
|
|
179
|
-
function toUnicode(input) {
|
|
180
|
-
assertIsString(input, {
|
|
181
|
-
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.toUnicode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
182
|
-
});
|
|
183
|
-
return mapDomain(
|
|
184
|
-
input,
|
|
185
|
-
(str) => regexPunycode.test(str) ? decode(str.slice(4).toLowerCase()) : str
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
function toASCII(input) {
|
|
189
|
-
assertIsString(input, {
|
|
190
|
-
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.toASCII\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
191
|
-
});
|
|
192
|
-
return mapDomain(
|
|
193
|
-
input,
|
|
194
|
-
(str) => regexNonASCII.test(str) ? "xn--" + encode(str) : str
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
var punycodeUtilsJS = {
|
|
198
|
-
version: "1.0.0",
|
|
199
|
-
ucs2: {
|
|
200
|
-
decode: ucs2decode,
|
|
201
|
-
encode: ucs2encode
|
|
202
|
-
},
|
|
203
|
-
decode,
|
|
204
|
-
encode,
|
|
205
|
-
toASCII,
|
|
206
|
-
toUnicode
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export { punycodeUtilsJS };
|
package/dist/chunk-7FGNVDEV.cjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var chunkSYHPSOUU_cjs = require('./chunk-SYHPSOUU.cjs');
|
|
13
|
-
|
|
14
|
-
var isEmptyArray = (value) => {
|
|
15
|
-
if (!chunkSYHPSOUU_cjs.isArray(value)) return true;
|
|
16
|
-
return value.length === 0;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function isEmptyObject(value, options = {}) {
|
|
20
|
-
if (!chunkSYHPSOUU_cjs.isObject(value)) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
chunkSYHPSOUU_cjs.assertIsPlainObject(options, {
|
|
24
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
25
|
-
});
|
|
26
|
-
const checkSymbols = chunkSYHPSOUU_cjs.hasOwnProp(options, "checkSymbols") ? options.checkSymbols : false;
|
|
27
|
-
chunkSYHPSOUU_cjs.assertIsBoolean(checkSymbols, {
|
|
28
|
-
message: ({ currentType, validType }) => `Parameter \`checkSymbols\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
29
|
-
});
|
|
30
|
-
const hasNoKeys = Object.keys(value).length === 0;
|
|
31
|
-
if (checkSymbols) {
|
|
32
|
-
return hasNoKeys && Object.getOwnPropertySymbols(value).length === 0;
|
|
33
|
-
}
|
|
34
|
-
return hasNoKeys;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
exports.isEmptyArray = isEmptyArray;
|
|
38
|
-
exports.isEmptyObject = isEmptyObject;
|
package/dist/chunk-AXDYWO67.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
import { isBigInt } from './chunk-QNKGP5DY.js';
|
|
11
|
-
import { assertIsPlainObject, isPlainObject, isBoolean, isNaN, hasOwnProp, getPreciseType, isUndefined, isNumberObject, isInfinityNumber, isStringObject, isBooleanObject, isFunction, isSymbol, isObjectOrArray, isSet, isArray, isNull, isNumber, isObject } from './chunk-MSUW5VHZ.js';
|
|
12
|
-
|
|
13
|
-
function isMap(value) {
|
|
14
|
-
return Object.prototype.toString.call(value) === "[object Map]" || value instanceof Map;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
var isDate = (value, options = {}) => {
|
|
18
|
-
assertIsPlainObject(options, {
|
|
19
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
20
|
-
});
|
|
21
|
-
const skipInvalidDate = isPlainObject(options) && isBoolean(options.skipInvalidDate) ? options.skipInvalidDate : false;
|
|
22
|
-
const instanceDate = value instanceof Date;
|
|
23
|
-
if (skipInvalidDate) return instanceDate;
|
|
24
|
-
return instanceDate && !isNaN(value.getTime());
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var safeStableStringify = (value, options = {}) => {
|
|
28
|
-
assertIsPlainObject(options, {
|
|
29
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
30
|
-
});
|
|
31
|
-
const pretty = hasOwnProp(options, "pretty") ? options.pretty : false;
|
|
32
|
-
const sortKeys = hasOwnProp(options, "sortKeys") ? options.sortKeys : true;
|
|
33
|
-
const sortArray = hasOwnProp(options, "sortArray") ? options.sortArray : false;
|
|
34
|
-
const keepUndefined = hasOwnProp(options, "keepUndefined") ? options.keepUndefined : false;
|
|
35
|
-
if (!isBoolean(sortKeys) || !isBoolean(sortArray) || !isBoolean(pretty) || !isBoolean(keepUndefined)) {
|
|
36
|
-
throw new TypeError(
|
|
37
|
-
`Parameters \`sortKeys\`, \`sortArray\`, \`keepUndefined\` and \`pretty\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: "['sortKeys': \`${getPreciseType(
|
|
38
|
-
sortKeys
|
|
39
|
-
)}\`, 'sortArray': \`${getPreciseType(
|
|
40
|
-
sortArray
|
|
41
|
-
)}\`, 'keepUndefined': \`${getPreciseType(
|
|
42
|
-
keepUndefined
|
|
43
|
-
)}\`, 'pretty': \`${getPreciseType(pretty)}\`]".`
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
if (isUndefined(value)) {
|
|
47
|
-
return keepUndefined ? "undefined" : "null";
|
|
48
|
-
}
|
|
49
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
50
|
-
const isPrimitive = (val) => isNull(val) || !isObjectOrArray(val) && !isFunction(val);
|
|
51
|
-
const deepProcess = (val) => {
|
|
52
|
-
if (isNumberObject(val)) {
|
|
53
|
-
const valOf = val.valueOf();
|
|
54
|
-
return isNaN(valOf) || isInfinityNumber(valOf) ? null : valOf;
|
|
55
|
-
}
|
|
56
|
-
if (isStringObject(val)) return val.valueOf();
|
|
57
|
-
if (isBooleanObject(val)) return val.valueOf();
|
|
58
|
-
if (isFunction(val) || isSymbol(val)) return void 0;
|
|
59
|
-
if (isBigInt(val)) return val.toString();
|
|
60
|
-
if (isNaN(val) || isInfinityNumber(val)) return null;
|
|
61
|
-
if (isUndefined(val)) {
|
|
62
|
-
return keepUndefined ? void 0 : null;
|
|
63
|
-
}
|
|
64
|
-
if (isObjectOrArray(val)) {
|
|
65
|
-
if (seen.has(val)) return "[Circular]";
|
|
66
|
-
seen.add(val);
|
|
67
|
-
if (isDate(val)) return val.toISOString();
|
|
68
|
-
if (isMap(val)) {
|
|
69
|
-
return {
|
|
70
|
-
map: Array.from(val.entries()).map(([k, v]) => [k, deepProcess(v)])
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (isSet(val)) return { set: Array.from(val.values()).map(deepProcess) };
|
|
74
|
-
if (isArray(val)) {
|
|
75
|
-
const processedArr = val.map(deepProcess);
|
|
76
|
-
if (sortArray) {
|
|
77
|
-
const primitives = [];
|
|
78
|
-
const nonPrimitives = [];
|
|
79
|
-
for (const item of processedArr) {
|
|
80
|
-
if (isPrimitive(item)) primitives.push(item);
|
|
81
|
-
else nonPrimitives.push(item);
|
|
82
|
-
}
|
|
83
|
-
primitives.sort((a, b) => {
|
|
84
|
-
if (isNumber(a) && isNumber(b)) return a - b;
|
|
85
|
-
return String(a).localeCompare(String(b));
|
|
86
|
-
});
|
|
87
|
-
return [...primitives, ...nonPrimitives];
|
|
88
|
-
}
|
|
89
|
-
return processedArr;
|
|
90
|
-
}
|
|
91
|
-
const keys = Object.keys(val);
|
|
92
|
-
if (sortKeys) {
|
|
93
|
-
keys.sort((a, b) => {
|
|
94
|
-
const na = Number(a);
|
|
95
|
-
const nb = Number(b);
|
|
96
|
-
if (!isNaN(na) && !isNaN(nb)) return na - nb;
|
|
97
|
-
return a.localeCompare(b);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
const result = {};
|
|
101
|
-
if (isObject(val)) {
|
|
102
|
-
for (const k of keys) {
|
|
103
|
-
const v = deepProcess(val[k]);
|
|
104
|
-
if (!isUndefined(v)) result[k] = v;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
return val;
|
|
110
|
-
};
|
|
111
|
-
try {
|
|
112
|
-
return JSON.stringify(deepProcess(value), null, pretty ? 2 : 0);
|
|
113
|
-
} catch (err) {
|
|
114
|
-
console.warn("Error in safeStableStringify:", err);
|
|
115
|
-
return "{}";
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export { isDate, isMap, safeStableStringify };
|
package/dist/chunk-B6PMNZ4M.cjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
13
|
-
var chunkSYHPSOUU_cjs = require('./chunk-SYHPSOUU.cjs');
|
|
14
|
-
|
|
15
|
-
var assertIsBigInt = (value, options = {}) => {
|
|
16
|
-
if (chunkUDA26MCU_cjs.isBigInt(value)) return;
|
|
17
|
-
chunkSYHPSOUU_cjs.resolveErrorMessageAssertions({
|
|
18
|
-
value,
|
|
19
|
-
options,
|
|
20
|
-
requiredValidType: "bigint"
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var assertIsNumber = (value, options = {}) => {
|
|
25
|
-
const includeNaN = chunkSYHPSOUU_cjs.hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
|
|
26
|
-
if (chunkSYHPSOUU_cjs.isNumber(value, { includeNaN })) return;
|
|
27
|
-
chunkSYHPSOUU_cjs.resolveErrorMessageAssertions({
|
|
28
|
-
value,
|
|
29
|
-
options,
|
|
30
|
-
requiredValidType: "number"
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.assertIsBigInt = assertIsBigInt;
|
|
35
|
-
exports.assertIsNumber = assertIsNumber;
|
package/dist/chunk-BAV5T2E3.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var noop = () => {
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.noop = noop;
|
package/dist/chunk-BLF7SD66.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
import { isEmptyString } from './chunk-ULQPCIA2.js';
|
|
11
|
-
import { isNonEmptyString, isPlainObject, isString, isNumber, getPreciseType } from './chunk-MSUW5VHZ.js';
|
|
12
|
-
|
|
13
|
-
var capitalizeFirst = (string, options = {
|
|
14
|
-
lowerCaseNextRest: true,
|
|
15
|
-
trim: false
|
|
16
|
-
}) => {
|
|
17
|
-
if (!isNonEmptyString(string)) return "";
|
|
18
|
-
if (!isPlainObject(options)) {
|
|
19
|
-
options = {};
|
|
20
|
-
}
|
|
21
|
-
const lowerCaseNextRest = options.lowerCaseNextRest !== false;
|
|
22
|
-
const trim = options.trim === true;
|
|
23
|
-
if (trim) string = string.trim();
|
|
24
|
-
return string[0].toUpperCase() + (lowerCaseNextRest ? string.slice(1).toLowerCase() : string.slice(1));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var capitalizeWords = (value, options = {
|
|
28
|
-
collapseSpaces: false,
|
|
29
|
-
trim: false
|
|
30
|
-
}) => {
|
|
31
|
-
if (!isNonEmptyString(value)) return "";
|
|
32
|
-
let result = value;
|
|
33
|
-
if (!isPlainObject(options)) {
|
|
34
|
-
options = {};
|
|
35
|
-
}
|
|
36
|
-
const collapseSpaces = options.collapseSpaces === true;
|
|
37
|
-
const trim = options.trim === true;
|
|
38
|
-
if (trim) {
|
|
39
|
-
result = result.trim();
|
|
40
|
-
}
|
|
41
|
-
if (collapseSpaces) {
|
|
42
|
-
const leadingSpaces = result.match(/^\s*/)?.[0] ?? "";
|
|
43
|
-
const trailingSpaces = result.match(/\s*$/)?.[0] ?? "";
|
|
44
|
-
result = result.trim().replace(/\s+/g, " ");
|
|
45
|
-
result = `${leadingSpaces}${result}${trailingSpaces}`;
|
|
46
|
-
}
|
|
47
|
-
return result.toLowerCase().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
function stripHtmlTags(input) {
|
|
51
|
-
if (!isString(input)) {
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
if (isEmptyString(input)) {
|
|
55
|
-
return "";
|
|
56
|
-
}
|
|
57
|
-
const stripped = input.replace(/<\/?[a-zA-Z][^<>]*\/?>/g, " ").trim();
|
|
58
|
-
const cleaned = stripped.replace(/\s+/g, " ").trim();
|
|
59
|
-
return cleaned;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var getInitialsName = (name) => {
|
|
63
|
-
if (!isNonEmptyString(name)) return "";
|
|
64
|
-
name = name.replace(/\s+/g, " ").trim();
|
|
65
|
-
const nameParts = name.split(" ");
|
|
66
|
-
if (nameParts.length > 1) {
|
|
67
|
-
return nameParts[0][0] + nameParts[1][0].toUpperCase();
|
|
68
|
-
}
|
|
69
|
-
return name.length > 1 ? name.substring(0, 2).toUpperCase() : (
|
|
70
|
-
// First two letters for single-word names
|
|
71
|
-
name[0].toUpperCase()
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var replaceAt = (index, originalString, replaceTo) => {
|
|
76
|
-
if (!isNumber(index) || !isString(replaceTo) || !isString(originalString)) {
|
|
77
|
-
throw new TypeError(
|
|
78
|
-
`First parameter (\`index\`) must be of type \`number\`, second parameter (\`originalString\`) and third parameter (\`replaceTo\`) must be of type \`string\`, but received: "['index': \`${getPreciseType(
|
|
79
|
-
index
|
|
80
|
-
)}\`, 'originalString': \`${getPreciseType(
|
|
81
|
-
originalString
|
|
82
|
-
)}\`, 'replaceTo': \`${getPreciseType(replaceTo)}\`]".`
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
if (index < 0 || index >= originalString.length) {
|
|
86
|
-
throw new RangeError(
|
|
87
|
-
`First parameter (\`index\`) is out of range from second parameter (\`originalString\`).`
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
return originalString.slice(0, index) + // Extract before the index
|
|
91
|
-
replaceTo + // Insert replacement
|
|
92
|
-
originalString.slice(index + 1);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export { capitalizeFirst, capitalizeWords, getInitialsName, replaceAt, stripHtmlTags };
|
package/dist/chunk-BMZZXZJ2.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.11.1.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var chunkSYHPSOUU_cjs = require('./chunk-SYHPSOUU.cjs');
|
|
13
|
-
|
|
14
|
-
var normalizeSpaces = (value, options = {
|
|
15
|
-
withTrim: true,
|
|
16
|
-
trimOnly: false
|
|
17
|
-
}) => {
|
|
18
|
-
if (!chunkSYHPSOUU_cjs.isNonEmptyString(value)) return "";
|
|
19
|
-
if (!chunkSYHPSOUU_cjs.isPlainObject(options)) {
|
|
20
|
-
options = {};
|
|
21
|
-
}
|
|
22
|
-
const { trimOnly = false, withTrim = true } = options;
|
|
23
|
-
if (trimOnly) return value.trim();
|
|
24
|
-
if (withTrim) {
|
|
25
|
-
value = value.trim();
|
|
26
|
-
}
|
|
27
|
-
return value.replace(/\s+/g, " ");
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.normalizeSpaces = normalizeSpaces;
|