@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.1
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 +69 -96
- package/dist/.references/index.d.cts +25 -0
- package/dist/.references/index.d.ts +25 -0
- package/dist/assertIsArray-DJXkjHZs.cjs +26 -0
- package/dist/assertIsArray-DJXkjHZs.cjs.map +1 -0
- package/dist/assertIsArray-bTA3XLjq.js +20 -0
- package/dist/assertIsArray-bTA3XLjq.js.map +1 -0
- package/dist/assertIsBoolean-C8WEXVr2.cjs +1283 -0
- package/dist/assertIsBoolean-C8WEXVr2.cjs.map +1 -0
- package/dist/assertIsBoolean-DR1SaXPD.js +1073 -0
- package/dist/assertIsBoolean-DR1SaXPD.js.map +1 -0
- package/dist/assertIsString-BiHQSrB2.cjs +26 -0
- package/dist/assertIsString-BiHQSrB2.cjs.map +1 -0
- package/dist/assertIsString-CEB07_83.js +20 -0
- package/dist/assertIsString-CEB07_83.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-BNIh_tCH.js +380 -0
- package/dist/conversions-BNIh_tCH.js.map +1 -0
- package/dist/conversions-D_Kh0a_C.cjs +446 -0
- package/dist/conversions-D_Kh0a_C.cjs.map +1 -0
- package/dist/events/index.cjs +55 -31
- package/dist/events/index.cjs.map +1 -0
- package/dist/events/index.d.cts +176 -0
- package/dist/events/index.d.ts +164 -166
- package/dist/events/index.js +50 -12
- package/dist/events/index.js.map +1 -0
- package/dist/formatEnvPort-B3OLxQk9.cjs +171 -0
- package/dist/formatEnvPort-B3OLxQk9.cjs.map +1 -0
- package/dist/formatEnvPort-ByFVLjSV.js +159 -0
- package/dist/formatEnvPort-ByFVLjSV.js.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--1m_vpE8.js +369 -0
- package/dist/formatters--1m_vpE8.js.map +1 -0
- package/dist/formatters-Cbij0XLU.cjs +429 -0
- package/dist/formatters-Cbij0XLU.cjs.map +1 -0
- package/dist/generators/index.cjs +165 -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 +158 -14
- package/dist/generators/index.js.map +1 -0
- package/dist/index-59zbLcPr.d.ts +340 -0
- package/dist/index-B6tawc8L.d.cts +1716 -0
- package/dist/index-C267akkJ.d.ts +2158 -0
- package/dist/index-CeBC2Vvl.d.cts +2361 -0
- package/dist/index-CgRDTI6f.d.ts +822 -0
- package/dist/index-CoiUBVmr.d.ts +720 -0
- package/dist/index-D4fcasfZ.d.cts +720 -0
- package/dist/index-DDrSQKIc.d.ts +1716 -0
- package/dist/index-DsGxO31H.d.cts +765 -0
- package/dist/index-Hg1qJkjl.d.ts +765 -0
- package/dist/index-Qm3iFwd0.d.cts +2158 -0
- package/dist/index-UPp94Agr.d.ts +2361 -0
- package/dist/index-gBA_8SuF.d.cts +340 -0
- package/dist/index-jyDqzicx.d.cts +822 -0
- package/dist/isBigInt-C4krUeAw.cjs +20 -0
- package/dist/isBigInt-C4krUeAw.cjs.map +1 -0
- package/dist/isBigInt-DKe0M6hp.js +14 -0
- package/dist/isBigInt-DKe0M6hp.js.map +1 -0
- package/dist/isEmptyObject-DCipFwxJ.js +25 -0
- package/dist/isEmptyObject-DCipFwxJ.js.map +1 -0
- package/dist/isEmptyObject-ZkSwRC_D.cjs +37 -0
- package/dist/isEmptyObject-ZkSwRC_D.cjs.map +1 -0
- package/dist/isEmptyString-BXzKAC2j.js +15 -0
- package/dist/isEmptyString-BXzKAC2j.js.map +1 -0
- package/dist/isEmptyString-UiiUsSQj.cjs +21 -0
- package/dist/isEmptyString-UiiUsSQj.cjs.map +1 -0
- package/dist/isEmptyValue-BQzcjVaL.cjs +30 -0
- package/dist/isEmptyValue-BQzcjVaL.cjs.map +1 -0
- package/dist/isEmptyValue-jqOr7OHD.js +24 -0
- package/dist/isEmptyValue-jqOr7OHD.js.map +1 -0
- package/dist/isEqual-BX49cF9m.js +87 -0
- package/dist/isEqual-BX49cF9m.js.map +1 -0
- package/dist/isEqual-BvumA3RA.cjs +111 -0
- package/dist/isEqual-BvumA3RA.cjs.map +1 -0
- package/dist/isFinite-BCnaDpod.js +15 -0
- package/dist/isFinite-BCnaDpod.js.map +1 -0
- package/dist/isFinite-D24ZaE6c.cjs +21 -0
- package/dist/isFinite-D24ZaE6c.cjs.map +1 -0
- package/dist/isInteger-Caeuz0rB.cjs +20 -0
- package/dist/isInteger-Caeuz0rB.cjs.map +1 -0
- package/dist/isInteger-naMbJsxJ.js +14 -0
- package/dist/isInteger-naMbJsxJ.js.map +1 -0
- package/dist/isPlainObject-BF-2-phb.d.cts +339 -0
- package/dist/isPlainObject-DxNDL8XU.d.ts +339 -0
- package/dist/isServer-BJHVnixd.cjs +20 -0
- package/dist/isServer-BJHVnixd.cjs.map +1 -0
- package/dist/isServer-Da3o3XSs.js +14 -0
- package/dist/isServer-Da3o3XSs.js.map +1 -0
- package/dist/isTypedArray-DuNA8tK6.js +31 -0
- package/dist/isTypedArray-DuNA8tK6.js.map +1 -0
- package/dist/isTypedArray-TJptiw2b.cjs +43 -0
- package/dist/isTypedArray-TJptiw2b.cjs.map +1 -0
- package/dist/isURL-C-kSk6KJ.js +14 -0
- package/dist/isURL-C-kSk6KJ.js.map +1 -0
- package/dist/isURL-DeUPO_oR.cjs +20 -0
- package/dist/isURL-DeUPO_oR.cjs.map +1 -0
- package/dist/isValidDomain-BB9IGhJs.cjs +1845 -0
- package/dist/isValidDomain-BB9IGhJs.cjs.map +1 -0
- package/dist/isValidDomain-DoE98yhJ.js +1827 -0
- package/dist/isValidDomain-DoE98yhJ.js.map +1 -0
- package/dist/next/index.cjs +119 -214
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +220 -0
- package/dist/next/index.d.ts +203 -214
- package/dist/next/index.js +117 -212
- 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 +34 -35
- package/dist/next/server/index.js +23 -38
- package/dist/next/server/index.js.map +1 -0
- package/dist/noop-B13_ii35.cjs +18 -0
- package/dist/noop-B13_ii35.cjs.map +1 -0
- package/dist/noop-ubqAIbHD.js +12 -0
- package/dist/noop-ubqAIbHD.js.map +1 -0
- package/dist/normalizeSpaces-Bg2IZW7W.js +23 -0
- package/dist/normalizeSpaces-Bg2IZW7W.js.map +1 -0
- package/dist/normalizeSpaces-ZXnR4Qzp.cjs +29 -0
- package/dist/normalizeSpaces-ZXnR4Qzp.cjs.map +1 -0
- package/dist/normalizeString-BDdkaXui.js +15 -0
- package/dist/normalizeString-BDdkaXui.js.map +1 -0
- package/dist/normalizeString-BE6ELqEb.cjs +21 -0
- package/dist/normalizeString-BE6ELqEb.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 +129 -134
- 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 +234 -235
- package/dist/parsers/index.js +10 -12
- package/dist/parsers-BSBPgvsq.js +643 -0
- package/dist/parsers-BSBPgvsq.js.map +1 -0
- package/dist/parsers-OqDeffqc.cjs +649 -0
- package/dist/parsers-OqDeffqc.cjs.map +1 -0
- package/dist/parsing-Cao8b358.js +50 -0
- package/dist/parsing-Cao8b358.js.map +1 -0
- package/dist/parsing-DOGSCH6N.cjs +56 -0
- package/dist/parsing-DOGSCH6N.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-Bj6meyXV.js +256 -0
- package/dist/predicates-Bj6meyXV.js.map +1 -0
- package/dist/predicates-D0ubqgqy.cjs +412 -0
- package/dist/predicates-D0ubqgqy.cjs.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 +116 -119
- package/dist/promises/index.js +73 -13
- package/dist/promises/index.js.map +1 -0
- package/dist/punyCode-8SrbMWfM.js +179 -0
- package/dist/punyCode-8SrbMWfM.js.map +1 -0
- package/dist/punyCode-D-Qu6nj6.cjs +185 -0
- package/dist/punyCode-D-Qu6nj6.cjs.map +1 -0
- package/dist/removeSpaces-Bmc5DX4F.js +19 -0
- package/dist/removeSpaces-Bmc5DX4F.js.map +1 -0
- package/dist/removeSpaces-CWIvhZHg.cjs +25 -0
- package/dist/removeSpaces-CWIvhZHg.cjs.map +1 -0
- package/dist/rzl-utils.global.js +20 -9
- package/dist/safeJsonParse-BP38mwlj.js +184 -0
- package/dist/safeJsonParse-BP38mwlj.js.map +1 -0
- package/dist/safeJsonParse-Sms2CJf4.cjs +208 -0
- package/dist/safeJsonParse-Sms2CJf4.cjs.map +1 -0
- package/dist/safeStableStringify-CJtP89qn.cjs +106 -0
- package/dist/safeStableStringify-CJtP89qn.cjs.map +1 -0
- package/dist/safeStableStringify-CXOZ9Ub8.js +88 -0
- package/dist/safeStableStringify-CXOZ9Ub8.js.map +1 -0
- package/dist/strings/index.cjs +79 -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 +62 -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-B2ssevxq.js +199 -0
- package/dist/tailwind-B2ssevxq.js.map +1 -0
- package/dist/tailwind-CHIx9uxu.cjs +247 -0
- package/dist/tailwind-CHIx9uxu.cjs.map +1 -0
- package/dist/toStringArrayUnRecursive-C4zYCja7.cjs +51 -0
- package/dist/toStringArrayUnRecursive-C4zYCja7.cjs.map +1 -0
- package/dist/toStringArrayUnRecursive-DJGtPsFb.js +39 -0
- package/dist/toStringArrayUnRecursive-DJGtPsFb.js.map +1 -0
- package/dist/urls/index.cjs +130 -57
- package/dist/urls/index.cjs.map +1 -0
- package/dist/urls/index.d.cts +737 -0
- package/dist/urls/index.d.ts +699 -708
- package/dist/urls/index.js +122 -26
- package/dist/urls/index.js.map +1 -0
- package/package.json +203 -194
- package/dist/chunk-2AFQ33D3.cjs +0 -64
- package/dist/chunk-2CYDJVGM.js +0 -246
- package/dist/chunk-2MW4JDQ2.cjs +0 -598
- package/dist/chunk-2VTDXC3N.cjs +0 -1825
- package/dist/chunk-44XX2P34.js +0 -209
- package/dist/chunk-4YLBKLGS.cjs +0 -18
- package/dist/chunk-566CXQW7.cjs +0 -560
- package/dist/chunk-57EPKYID.cjs +0 -397
- package/dist/chunk-5MGEC3YG.js +0 -63
- package/dist/chunk-6EF52423.cjs +0 -249
- package/dist/chunk-6SCOKU3S.js +0 -109
- package/dist/chunk-6VUXD3CF.js +0 -119
- package/dist/chunk-7B76BSNK.cjs +0 -118
- package/dist/chunk-7Y6I2DSU.cjs +0 -101
- package/dist/chunk-A7S7E2EE.cjs +0 -308
- package/dist/chunk-AJZ6PMMZ.js +0 -16
- package/dist/chunk-AXGBL2IO.cjs +0 -251
- package/dist/chunk-B4TC6FBV.cjs +0 -678
- package/dist/chunk-BAV5T2E3.cjs +0 -15
- package/dist/chunk-BKIJBNIE.js +0 -21
- package/dist/chunk-BNIMTFK5.js +0 -59
- package/dist/chunk-BXW7YXB7.js +0 -1823
- package/dist/chunk-CFYZC4S6.js +0 -53
- package/dist/chunk-CSG4SCL3.js +0 -1587
- package/dist/chunk-CWQW7AKK.js +0 -676
- package/dist/chunk-DVMHRLKP.cjs +0 -16
- package/dist/chunk-EN7LVZBZ.js +0 -548
- package/dist/chunk-EV4Y7HCY.cjs +0 -26
- package/dist/chunk-F66VDYIZ.cjs +0 -18
- package/dist/chunk-FLJX37EL.cjs +0 -30
- package/dist/chunk-GKC3UDMC.cjs +0 -1623
- package/dist/chunk-H65I3GRZ.cjs +0 -106
- package/dist/chunk-HHYWB7VZ.js +0 -24
- package/dist/chunk-HNGGISFL.cjs +0 -65
- package/dist/chunk-HNSQAVSZ.cjs +0 -35
- package/dist/chunk-HSP6IWZK.js +0 -17
- package/dist/chunk-IDZS7J6T.js +0 -242
- package/dist/chunk-JS6R55VL.js +0 -302
- package/dist/chunk-JZVT5FK7.js +0 -232
- package/dist/chunk-KHO2SBNA.cjs +0 -16
- package/dist/chunk-KIDJCMNJ.js +0 -33
- package/dist/chunk-KOLEURVT.cjs +0 -38
- package/dist/chunk-L4V53MQK.cjs +0 -269
- package/dist/chunk-L5RDAVVH.js +0 -14
- package/dist/chunk-NODTV4F3.js +0 -16
- package/dist/chunk-NYK5K3V2.cjs +0 -211
- package/dist/chunk-ODUO3RTL.cjs +0 -113
- package/dist/chunk-ONZFBJVW.js +0 -14
- package/dist/chunk-PFXCTE37.js +0 -28
- package/dist/chunk-PPST7QAQ.js +0 -587
- package/dist/chunk-Q5IMYDFL.cjs +0 -33
- package/dist/chunk-QFFBIOJ4.js +0 -31
- package/dist/chunk-QNKGP5DY.js +0 -14
- package/dist/chunk-RRQHMOPE.cjs +0 -19
- package/dist/chunk-RU5OSRBU.js +0 -95
- package/dist/chunk-SDMPEJ4F.js +0 -35
- package/dist/chunk-SYNL5IKP.js +0 -115
- package/dist/chunk-TCDOWZQE.js +0 -16
- package/dist/chunk-TQPGXGKB.cjs +0 -123
- package/dist/chunk-TULOI4GL.js +0 -370
- package/dist/chunk-UBHCP4N5.cjs +0 -36
- package/dist/chunk-UCHF3M34.cjs +0 -56
- package/dist/chunk-UDA26MCU.cjs +0 -16
- package/dist/chunk-V3C4FYZL.cjs +0 -18
- package/dist/chunk-VAAHZFBF.js +0 -32
- package/dist/chunk-VJDDGRIK.cjs +0 -16
- package/dist/chunk-WVSPXFTY.js +0 -14
- package/dist/chunk-WYP76WXB.js +0 -101
- package/dist/chunk-YDE4ZBB7.cjs +0 -237
- package/dist/chunk-YKQEOO7C.cjs +0 -23
- package/dist/chunk-YSZC56SZ.js +0 -264
- package/dist/chunk-YWHHVDT4.js +0 -13
- package/dist/index.d.ts +0 -24
- package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
package/dist/chunk-TULOI4GL.js
DELETED
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
import { isURL } from './chunk-ONZFBJVW.js';
|
|
11
|
-
import { isTypedArray } from './chunk-KIDJCMNJ.js';
|
|
12
|
-
import { parseCurrencyString } from './chunk-5MGEC3YG.js';
|
|
13
|
-
import { isEmptyString } from './chunk-TCDOWZQE.js';
|
|
14
|
-
import { assertIsString } from './chunk-BKIJBNIE.js';
|
|
15
|
-
import { isEqual, isRegExp, baseDeepEqual } from './chunk-WYP76WXB.js';
|
|
16
|
-
import { isEmptyArray } from './chunk-SDMPEJ4F.js';
|
|
17
|
-
import { safeStableStringify, isDate, isMap } from './chunk-6VUXD3CF.js';
|
|
18
|
-
import { isArray, getPreciseType, assertIsBoolean, isNonEmptyString, assertIsPlainObject, isObjectOrArray, isFunction, isString, isNumber, isSymbol, isSet, isPlainObject, isNil, isBoolean, isBuffer, isNaN, isUndefined, isObject, isNull } from './chunk-CSG4SCL3.js';
|
|
19
|
-
|
|
20
|
-
var areArraysEqual = (array1, array2, ignoreOrder = false) => {
|
|
21
|
-
if (!(isArray(array1) && isArray(array2))) {
|
|
22
|
-
throw new TypeError(
|
|
23
|
-
`Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${getPreciseType(
|
|
24
|
-
array1
|
|
25
|
-
)}\`, 'array2': \`${getPreciseType(array2)}\`].`
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
assertIsBoolean(ignoreOrder, {
|
|
29
|
-
message: ({ currentType, validType }) => `Third parameter \`ignoreOrder\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
30
|
-
});
|
|
31
|
-
if (!isEqual(array1.length, array2.length)) return false;
|
|
32
|
-
const deepIgnoreOrder = (arr) => {
|
|
33
|
-
if (!isArray(arr)) return arr;
|
|
34
|
-
const sorted = arr.map((item) => {
|
|
35
|
-
if (isArray(item)) {
|
|
36
|
-
return deepIgnoreOrder(item);
|
|
37
|
-
}
|
|
38
|
-
return item;
|
|
39
|
-
});
|
|
40
|
-
return sorted.sort((a, b) => {
|
|
41
|
-
const sa = safeStableStringify(a);
|
|
42
|
-
const sb = safeStableStringify(b);
|
|
43
|
-
return sa < sb ? -1 : sa > sb ? 1 : 0;
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
const normalizedArr1 = ignoreOrder ? deepIgnoreOrder(array1) : array1;
|
|
47
|
-
const normalizedArr2 = ignoreOrder ? deepIgnoreOrder(array2) : array2;
|
|
48
|
-
if (!isEqual(normalizedArr1.length, normalizedArr2.length)) return false;
|
|
49
|
-
return normalizedArr1.every(
|
|
50
|
-
(item, index) => safeStableStringify(item) === safeStableStringify(normalizedArr2[index])
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var areObjectsEqual = (object1, object2) => {
|
|
55
|
-
return isEqual(object1, object2);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
var areURLsEqualPath = (urlA, urlB) => {
|
|
59
|
-
if (!isURL(urlA) || !isURL(urlB)) {
|
|
60
|
-
throw new TypeError(
|
|
61
|
-
`Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
return urlA.protocol + "//" + urlA.host + urlA.pathname === urlB.protocol + "//" + urlB.host + urlB.pathname;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var areURLsIdentical = (urlA, urlB) => {
|
|
68
|
-
if (!isURL(urlA) || !isURL(urlB)) {
|
|
69
|
-
throw new TypeError(
|
|
70
|
-
`Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return urlA.protocol + "//" + urlA.host + urlA.pathname + urlA.search === urlB.protocol + "//" + urlB.host + urlB.pathname + urlB.search;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var textContainsAll = (text, searchWords, options = {}) => {
|
|
77
|
-
if (!isNonEmptyString(text) || !isArray(searchWords)) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
assertIsPlainObject(options, {
|
|
81
|
-
message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
82
|
-
});
|
|
83
|
-
const { exactMatch = false, flags = "i" } = options;
|
|
84
|
-
assertIsBoolean(exactMatch, {
|
|
85
|
-
message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
86
|
-
});
|
|
87
|
-
assertIsString(flags, {
|
|
88
|
-
message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
89
|
-
});
|
|
90
|
-
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
91
|
-
const validSearchWords = searchWords.filter((word) => isNonEmptyString(word)).map(escapeRegex);
|
|
92
|
-
if (validSearchWords.length === 0) return false;
|
|
93
|
-
return validSearchWords.every((word) => {
|
|
94
|
-
const pattern = exactMatch ? `(?<!\\S)${word}(?!\\S)` : word;
|
|
95
|
-
return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
var textContainsAny = (text, searchWords, options = {}) => {
|
|
100
|
-
if (!isNonEmptyString(text) || !isArray(searchWords)) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
assertIsPlainObject(options, {
|
|
104
|
-
message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
105
|
-
});
|
|
106
|
-
const { exactMatch = false, flags = "i" } = options;
|
|
107
|
-
assertIsBoolean(exactMatch, {
|
|
108
|
-
message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
109
|
-
});
|
|
110
|
-
assertIsString(flags, {
|
|
111
|
-
message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
112
|
-
});
|
|
113
|
-
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
114
|
-
const validSearchWords = searchWords.filter((word) => isNonEmptyString(word)).map(escapeRegex);
|
|
115
|
-
if (validSearchWords.length === 0) return false;
|
|
116
|
-
const pattern = exactMatch ? `(?<!\\S)(${validSearchWords.join("|")})(?!\\S)` : `(${validSearchWords.join("|")})`;
|
|
117
|
-
return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
function isPropertyKey(value) {
|
|
121
|
-
const type = typeof value;
|
|
122
|
-
return type === "string" || type === "number" || type === "symbol";
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
var doesKeyExist = (object, key) => {
|
|
126
|
-
if (!isObjectOrArray(object)) return false;
|
|
127
|
-
if (!isPropertyKey(key)) {
|
|
128
|
-
throw new TypeError(
|
|
129
|
-
`Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${getPreciseType(
|
|
130
|
-
key
|
|
131
|
-
)}\`.`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
if (Object.prototype.hasOwnProperty.call(object, key)) return true;
|
|
135
|
-
if (isArray(object)) {
|
|
136
|
-
return object.some((item) => doesKeyExist(item, key));
|
|
137
|
-
}
|
|
138
|
-
return Object.values(object).some(
|
|
139
|
-
(value) => isObjectOrArray(value) && doesKeyExist(value, key)
|
|
140
|
-
);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
var arrayHasAnyMatch = (sourceArray, targetArray) => {
|
|
144
|
-
if (!isArray(sourceArray) || !isArray(targetArray) || isEmptyArray(sourceArray) || isEmptyArray(targetArray)) {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
const sourceSet = new Set(sourceArray);
|
|
148
|
-
return targetArray.some((item) => sourceSet.has(item));
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
var isArguments = (value) => {
|
|
152
|
-
return Object.prototype.toString.call(value) === "[object Arguments]";
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
function isLength(value) {
|
|
156
|
-
return typeof value === "number" && value > -1 && Number.isInteger(value) && value <= Number.MAX_SAFE_INTEGER;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function isArrayLike(value) {
|
|
160
|
-
return !isFunction(value) && isObjectOrArray(value) && isLength(value?.length);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function isArrayLikeObject(value) {
|
|
164
|
-
return isObjectOrArray(value) && isLength(value.length);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
var isCurrencyLike = (input) => {
|
|
168
|
-
if (!(isString(input) || isNumber(input))) return false;
|
|
169
|
-
const parsed = parseCurrencyString(input.toString());
|
|
170
|
-
if (parsed !== 0) return true;
|
|
171
|
-
return input.toString().trim() === "0";
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
var isDeepEqual = (a, b) => {
|
|
175
|
-
if (typeof a === "number" && typeof b === "number" && Number.isNaN(a) && Number.isNaN(b)) {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
if (a === b) return true;
|
|
179
|
-
if (typeof a !== typeof b) return false;
|
|
180
|
-
if (isDate(a) && isDate(b)) {
|
|
181
|
-
return a.getTime() === b.getTime();
|
|
182
|
-
}
|
|
183
|
-
if (isRegExp(a) && isRegExp(b)) {
|
|
184
|
-
return a.toString() === b.toString();
|
|
185
|
-
}
|
|
186
|
-
if (isSymbol(a) && isSymbol(b)) {
|
|
187
|
-
return a.toString() === b.toString();
|
|
188
|
-
}
|
|
189
|
-
if (isSet(a) && isSet(b)) {
|
|
190
|
-
if (a.size !== b.size) return false;
|
|
191
|
-
const bValues = Array.from(b);
|
|
192
|
-
const matched = /* @__PURE__ */ new Set();
|
|
193
|
-
for (const aVal of a) {
|
|
194
|
-
let found = false;
|
|
195
|
-
for (let i = 0; i < bValues.length; i++) {
|
|
196
|
-
if (matched.has(i)) continue;
|
|
197
|
-
if (isDeepEqual(aVal, bValues[i])) {
|
|
198
|
-
matched.add(i);
|
|
199
|
-
found = true;
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
if (!found) return false;
|
|
204
|
-
}
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
if (isMap(a) && isMap(b)) {
|
|
208
|
-
if (a.size !== b.size) return false;
|
|
209
|
-
const bEntries = Array.from(b);
|
|
210
|
-
const matched = /* @__PURE__ */ new Set();
|
|
211
|
-
for (const [aKey, aVal] of a) {
|
|
212
|
-
let found = false;
|
|
213
|
-
for (let i = 0; i < bEntries.length; i++) {
|
|
214
|
-
if (matched.has(i)) continue;
|
|
215
|
-
const [bKey, bVal] = bEntries[i];
|
|
216
|
-
if (isDeepEqual(aKey, bKey) && isDeepEqual(aVal, bVal)) {
|
|
217
|
-
matched.add(i);
|
|
218
|
-
found = true;
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (!found) return false;
|
|
223
|
-
}
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
if (isArray(a) && isArray(b)) {
|
|
227
|
-
if (a.length !== b.length) return false;
|
|
228
|
-
return a.every((item, i) => isDeepEqual(item, b[i]));
|
|
229
|
-
}
|
|
230
|
-
if (isObjectOrArray(a) && isObjectOrArray(b) && a && b) {
|
|
231
|
-
if (isArray(a) !== isArray(b)) return false;
|
|
232
|
-
const aKeys = Object.keys(a);
|
|
233
|
-
const bKeys = Object.keys(b);
|
|
234
|
-
if (aKeys.length !== bKeys.length) return false;
|
|
235
|
-
return aKeys.every((key) => isDeepEqual(a[key], b[key]));
|
|
236
|
-
}
|
|
237
|
-
return false;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
function isElement(value) {
|
|
241
|
-
return !!value && typeof value === "object" && value?.nodeType === 1 && !isPlainObject(value);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function isEmpty(value) {
|
|
245
|
-
if (isNil(value)) return true;
|
|
246
|
-
if (isBoolean(value) || isNumber(value, { includeNaN: true }) || isSymbol(value))
|
|
247
|
-
return true;
|
|
248
|
-
if (isFunction(value)) {
|
|
249
|
-
return Object.keys(value).length === 0;
|
|
250
|
-
}
|
|
251
|
-
if (isString(value) || isArray(value) || isArguments(value) || isTypedArray(value)) {
|
|
252
|
-
return value.length === 0;
|
|
253
|
-
}
|
|
254
|
-
if (isMap(value) || isSet(value)) {
|
|
255
|
-
return value.size === 0;
|
|
256
|
-
}
|
|
257
|
-
if (isBuffer(value)) {
|
|
258
|
-
return value.length === 0;
|
|
259
|
-
}
|
|
260
|
-
if (isPlainObject(value)) {
|
|
261
|
-
return Object.keys(value).length === 0;
|
|
262
|
-
}
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
var isEmptyDeep = (value) => {
|
|
267
|
-
if (isString(value)) return isEmptyString(value);
|
|
268
|
-
if (isNumber(value)) return isNaN(value);
|
|
269
|
-
if (isArray(value)) {
|
|
270
|
-
return isEmptyArray(value) || value.every(isEmptyDeep);
|
|
271
|
-
}
|
|
272
|
-
if (isObjectOrArray(value)) {
|
|
273
|
-
const keys = Object.keys(value);
|
|
274
|
-
const symbols = Object.getOwnPropertySymbols(value);
|
|
275
|
-
if (keys.length === 0 && symbols.length === 0) return true;
|
|
276
|
-
return [...keys, ...symbols].every((key) => isEmptyDeep(value[key]));
|
|
277
|
-
}
|
|
278
|
-
if (!value) return true;
|
|
279
|
-
return false;
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
function isEqualWith(value, other, customizer) {
|
|
283
|
-
return baseDeepEqual(value, other, customizer, /* @__PURE__ */ new WeakMap());
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function isMatchWith(value, other, customizer) {
|
|
287
|
-
return baseIsMatch(value, other, customizer);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function isSameValue(x, y) {
|
|
291
|
-
return x === y || x === 0 && y === 0 || Number.isNaN(x) && Number.isNaN(y);
|
|
292
|
-
}
|
|
293
|
-
function baseIsMatch(object, source, customizer) {
|
|
294
|
-
if (object === source) return true;
|
|
295
|
-
if (!isObjectOrArray(source)) {
|
|
296
|
-
return isSameValue(object, source);
|
|
297
|
-
}
|
|
298
|
-
if (!isObjectOrArray(object)) {
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
const keys = Reflect.ownKeys(source).filter(
|
|
302
|
-
(k) => !(isArray(source) && k === "length")
|
|
303
|
-
);
|
|
304
|
-
for (const key of keys) {
|
|
305
|
-
if (!(key in object)) return false;
|
|
306
|
-
const objValue = object[key];
|
|
307
|
-
const srcValue = source[key];
|
|
308
|
-
const result = customizer?.(objValue, srcValue, key, object, source);
|
|
309
|
-
if (!isUndefined(result)) {
|
|
310
|
-
if (!result) return false;
|
|
311
|
-
continue;
|
|
312
|
-
}
|
|
313
|
-
if (isObjectOrArray(objValue) && isObjectOrArray(srcValue)) {
|
|
314
|
-
if (!isMatchWith(objValue, srcValue, customizer)) return false;
|
|
315
|
-
} else {
|
|
316
|
-
if (!isSameValue(objValue, srcValue)) return false;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return true;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
function isMatch(object, source) {
|
|
323
|
-
return baseIsMatch(object, source);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
var funcToString = Function.prototype.toString;
|
|
327
|
-
var reIsNative = /\{\s*\[native code\]\s*\}/;
|
|
328
|
-
function isNative(value) {
|
|
329
|
-
if (!isFunction(value)) return false;
|
|
330
|
-
try {
|
|
331
|
-
const source = funcToString.call(value);
|
|
332
|
-
return reIsNative.test(source);
|
|
333
|
-
} catch {
|
|
334
|
-
return false;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function isObjectLoose(value) {
|
|
339
|
-
return !isNil(value) && (isObjectOrArray(value) || isFunction(value));
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function isSafeInteger(value) {
|
|
343
|
-
return typeof value === "number" && Number.isSafeInteger(value);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
var isValidURL = (url) => {
|
|
347
|
-
if (!isNonEmptyString(url)) return false;
|
|
348
|
-
let decodedUrl;
|
|
349
|
-
try {
|
|
350
|
-
decodedUrl = decodeURIComponent(url);
|
|
351
|
-
} catch {
|
|
352
|
-
return false;
|
|
353
|
-
}
|
|
354
|
-
if (!decodedUrl.startsWith("http://") && !decodedUrl.startsWith("https://")) {
|
|
355
|
-
return false;
|
|
356
|
-
}
|
|
357
|
-
const urlPattern = new RegExp(
|
|
358
|
-
/^https?:\/\/(?:localhost(?::\d+)?(?:[\/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?::\d+)?(?:[\/?#][^\s]*)?)$/
|
|
359
|
-
//! DEPRECATED
|
|
360
|
-
// /^https?:\/\/(?:localhost(?::\d+)?(?:[/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6})(?:[/?#][^\s]*)?$/
|
|
361
|
-
// /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/
|
|
362
|
-
);
|
|
363
|
-
return urlPattern.test(decodedUrl);
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
function isWeakMap(value) {
|
|
367
|
-
return isObject(value) && !isNull(value) && value instanceof WeakMap;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
export { areArraysEqual, areObjectsEqual, areURLsEqualPath, areURLsIdentical, arrayHasAnyMatch, doesKeyExist, isArguments, isArrayLike, isArrayLikeObject, isCurrencyLike, isDeepEqual, isElement, isEmpty, isEmptyDeep, isEqualWith, isLength, isMatch, isMatchWith, isNative, isObjectLoose, isPropertyKey, isSafeInteger, isValidURL, isWeakMap, textContainsAll, textContainsAny };
|
package/dist/chunk-UBHCP4N5.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var chunkQ5IMYDFL_cjs = require('./chunk-Q5IMYDFL.cjs');
|
|
13
|
-
|
|
14
|
-
var isNonEmptyValue = (value, options = {}) => {
|
|
15
|
-
return !chunkQ5IMYDFL_cjs.isEmptyValue(value, options);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
var typedArrayTags = /* @__PURE__ */ new Set([
|
|
19
|
-
"[object Int8Array]",
|
|
20
|
-
"[object Uint8Array]",
|
|
21
|
-
"[object Uint8ClampedArray]",
|
|
22
|
-
"[object Int16Array]",
|
|
23
|
-
"[object Uint16Array]",
|
|
24
|
-
"[object Int32Array]",
|
|
25
|
-
"[object Uint32Array]",
|
|
26
|
-
"[object Float32Array]",
|
|
27
|
-
"[object Float64Array]",
|
|
28
|
-
"[object BigInt64Array]",
|
|
29
|
-
"[object BigUint64Array]"
|
|
30
|
-
]);
|
|
31
|
-
function isTypedArray(value) {
|
|
32
|
-
return value != null && typeof value === "object" && typedArrayTags.has(Object.prototype.toString.call(value));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exports.isNonEmptyValue = isNonEmptyValue;
|
|
36
|
-
exports.isTypedArray = isTypedArray;
|
package/dist/chunk-UCHF3M34.cjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var chunkV3C4FYZL_cjs = require('./chunk-V3C4FYZL.cjs');
|
|
13
|
-
var chunkKOLEURVT_cjs = require('./chunk-KOLEURVT.cjs');
|
|
14
|
-
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
15
|
-
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
16
|
-
|
|
17
|
-
function filterNilArray(input) {
|
|
18
|
-
if (chunkGKC3UDMC_cjs.isNil(input)) return void 0;
|
|
19
|
-
if (!chunkGKC3UDMC_cjs.isArray(input)) return [];
|
|
20
|
-
const filtered = input.reduce((output, element) => {
|
|
21
|
-
if (!chunkGKC3UDMC_cjs.isNil(element)) {
|
|
22
|
-
if (chunkGKC3UDMC_cjs.isArray(element)) {
|
|
23
|
-
const cleanedNested = filterNilArray(element);
|
|
24
|
-
if (cleanedNested && !chunkKOLEURVT_cjs.isEmptyArray(cleanedNested)) {
|
|
25
|
-
output.push(cleanedNested);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
output.push(element);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return output;
|
|
32
|
-
}, []);
|
|
33
|
-
return filtered;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function toStringArrayUnRecursive(array, options = {}) {
|
|
37
|
-
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
38
|
-
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
39
|
-
});
|
|
40
|
-
const riv = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeInvalidValue") ? options.removeInvalidValue : true;
|
|
41
|
-
chunkGKC3UDMC_cjs.assertIsBoolean(riv, {
|
|
42
|
-
message: ({ currentType, validType }) => `Parameter \`removeInvalidValue\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
43
|
-
});
|
|
44
|
-
if (chunkGKC3UDMC_cjs.isArray(array)) {
|
|
45
|
-
const result = Array.from(array, (x) => {
|
|
46
|
-
if (chunkGKC3UDMC_cjs.isString(x) || chunkV3C4FYZL_cjs.isFinite(x) || chunkGKC3UDMC_cjs.isBoolean(x) || chunkUDA26MCU_cjs.isBigInt(x)) return String(x);
|
|
47
|
-
return chunkGKC3UDMC_cjs.isNull(x) ? null : void 0;
|
|
48
|
-
});
|
|
49
|
-
if (riv) return filterNilArray(result);
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
exports.filterNilArray = filterNilArray;
|
|
56
|
-
exports.toStringArrayUnRecursive = toStringArrayUnRecursive;
|
package/dist/chunk-UDA26MCU.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var isBigInt = (value) => {
|
|
13
|
-
return typeof value === "bigint";
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.isBigInt = isBigInt;
|
package/dist/chunk-V3C4FYZL.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
13
|
-
|
|
14
|
-
function isFinite(value) {
|
|
15
|
-
return chunkGKC3UDMC_cjs.isNumber(value) && Number.isFinite(value);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exports.isFinite = isFinite;
|
package/dist/chunk-VAAHZFBF.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
import { isBigInt } from './chunk-QNKGP5DY.js';
|
|
11
|
-
import { resolveErrorMessageAssertions, hasOwnProp, isNumber } from './chunk-CSG4SCL3.js';
|
|
12
|
-
|
|
13
|
-
var assertIsBigInt = (value, options = {}) => {
|
|
14
|
-
if (isBigInt(value)) return;
|
|
15
|
-
resolveErrorMessageAssertions({
|
|
16
|
-
value,
|
|
17
|
-
options,
|
|
18
|
-
requiredValidType: "bigint"
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var assertIsNumber = (value, options = {}) => {
|
|
23
|
-
const includeNaN = hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
|
|
24
|
-
if (isNumber(value, { includeNaN })) return;
|
|
25
|
-
resolveErrorMessageAssertions({
|
|
26
|
-
value,
|
|
27
|
-
options,
|
|
28
|
-
requiredValidType: "number"
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { assertIsBigInt, assertIsNumber };
|
package/dist/chunk-VJDDGRIK.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var isServer = () => {
|
|
13
|
-
return typeof window === "undefined" || typeof document === "undefined";
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.isServer = isServer;
|
package/dist/chunk-WVSPXFTY.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
function isInteger(value) {
|
|
11
|
-
return typeof value === "number" && Number.isInteger(value);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { isInteger };
|
package/dist/chunk-WYP76WXB.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ====================================================
|
|
3
|
-
* Rzl Utils-JS.
|
|
4
|
-
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.12.0.
|
|
6
|
-
* Author: Rizalvin Dwiky.
|
|
7
|
-
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
-
* ====================================================
|
|
9
|
-
*/
|
|
10
|
-
import { isDate, isMap } from './chunk-6VUXD3CF.js';
|
|
11
|
-
import { isObjectOrArray, isError, isSet, isArray, isUndefined } from './chunk-CSG4SCL3.js';
|
|
12
|
-
|
|
13
|
-
var isRegExp = (value) => {
|
|
14
|
-
return value instanceof RegExp;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
function isArrayBuffer(value) {
|
|
18
|
-
return value instanceof ArrayBuffer;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new WeakMap()) {
|
|
22
|
-
if (value === other) return true;
|
|
23
|
-
if (value !== value && other !== other) return true;
|
|
24
|
-
if (!isObjectOrArray(value) || !isObjectOrArray(other)) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (seen.get(value) === other) return true;
|
|
28
|
-
seen.set(value, other);
|
|
29
|
-
const callCustomizer = (v, o, key, valObj, othObj) => {
|
|
30
|
-
if (customizer) {
|
|
31
|
-
const result = customizer(v, o, key, valObj, othObj, seen);
|
|
32
|
-
if (!isUndefined(result)) return result;
|
|
33
|
-
}
|
|
34
|
-
return baseDeepEqual(v, o, customizer, seen);
|
|
35
|
-
};
|
|
36
|
-
if (isDate(value) && isDate(other)) return value.getTime() === other.getTime();
|
|
37
|
-
if (isRegExp(value) && isRegExp(other))
|
|
38
|
-
return value.source === other.source && value.flags === other.flags;
|
|
39
|
-
if (isError(value) && isError(other))
|
|
40
|
-
return value.name === other.name && value.message === other.message;
|
|
41
|
-
if (ArrayBuffer.isView(value) && ArrayBuffer.isView(other)) {
|
|
42
|
-
const v = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
43
|
-
const o = new Uint8Array(other.buffer, other.byteOffset, other.byteLength);
|
|
44
|
-
if (v.length !== o.length) return false;
|
|
45
|
-
for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
if (isArrayBuffer(value) && isArrayBuffer(other)) {
|
|
49
|
-
if (value.byteLength !== other.byteLength) return false;
|
|
50
|
-
const v = new Uint8Array(value), o = new Uint8Array(other);
|
|
51
|
-
for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
if (isMap(value) && isMap(other)) {
|
|
55
|
-
if (value.size !== other.size) return false;
|
|
56
|
-
for (const [k, v] of value) {
|
|
57
|
-
if (!other.has(k)) return false;
|
|
58
|
-
if (!baseDeepEqual(v, other.get(k), customizer, seen)) return false;
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
if (isSet(value) && isSet(other)) {
|
|
63
|
-
if (value.size !== other.size) return false;
|
|
64
|
-
for (const v of value) {
|
|
65
|
-
let matched = false;
|
|
66
|
-
for (const o of other) {
|
|
67
|
-
if (baseDeepEqual(v, o, customizer, seen)) {
|
|
68
|
-
matched = true;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (!matched) return false;
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
if (isArray(value) && isArray(other)) {
|
|
77
|
-
if (value.length !== other.length) return false;
|
|
78
|
-
for (let i = 0; i < value.length; i++) {
|
|
79
|
-
if (!callCustomizer(value[i], other[i], i, value, other)) return false;
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
if (Object.getPrototypeOf(value) !== Object.getPrototypeOf(other)) {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
const vKeys = Reflect.ownKeys(value);
|
|
87
|
-
const oKeys = Reflect.ownKeys(other);
|
|
88
|
-
if (vKeys.length !== oKeys.length) return false;
|
|
89
|
-
for (const key of vKeys) {
|
|
90
|
-
const vVal = value[key];
|
|
91
|
-
const oVal = other[key];
|
|
92
|
-
if (!callCustomizer(vVal, oVal, key, value, other)) return false;
|
|
93
|
-
}
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function isEqual(value, other) {
|
|
98
|
-
return baseDeepEqual(value, other, void 0, /* @__PURE__ */ new WeakMap());
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export { baseDeepEqual, isArrayBuffer, isEqual, isRegExp };
|