@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
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import '../chunk-TCDOWZQE.js';
|
|
17
|
-
import '../chunk-BKIJBNIE.js';
|
|
18
|
-
export { cleanParsedData, extractDigits, parseCustomDate, safeJsonParse } from '../chunk-YSZC56SZ.js';
|
|
19
|
-
import '../chunk-WYP76WXB.js';
|
|
20
|
-
import '../chunk-SDMPEJ4F.js';
|
|
21
|
-
import '../chunk-HSP6IWZK.js';
|
|
22
|
-
import '../chunk-YWHHVDT4.js';
|
|
23
|
-
export { safeStableStringify } from '../chunk-6VUXD3CF.js';
|
|
24
|
-
import '../chunk-QNKGP5DY.js';
|
|
25
|
-
import '../chunk-CSG4SCL3.js';
|
|
2
|
+
* ========================================================================
|
|
3
|
+
* @rzl-zone/utils-js
|
|
4
|
+
* ------------------------------------------------------------------------
|
|
5
|
+
* Version: `3.12.1-beta.1`
|
|
6
|
+
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
|
+
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
|
+
* ========================================================================
|
|
9
|
+
*/
|
|
10
|
+
import { n as filterNilArray, t as toStringArrayUnRecursive } from "../toStringArrayUnRecursive-DJGtPsFb.js";
|
|
11
|
+
import { a as toBooleanLoose, c as toBooleanContent, d as toNumberArrayUnRecursive, i as convertType, l as dedupeArray, n as toNumberDeep, o as toBooleanExplicit, r as removeObjectPaths, s as toBooleanContentDeep, t as toStringDeep, u as toStringDeepForce } from "../conversions-BNIh_tCH.js";
|
|
12
|
+
import { t as safeStableStringify } from "../safeStableStringify-CXOZ9Ub8.js";
|
|
13
|
+
import { t as parseCurrencyString } from "../parsing-Cao8b358.js";
|
|
14
|
+
import { i as parseCustomDate, n as extractDigits, r as cleanParsedData, t as safeJsonParse } from "../safeJsonParse-BP38mwlj.js";
|
|
15
|
+
export { cleanParsedData, convertType, dedupeArray, extractDigits, filterNilArray, parseCurrencyString, parseCustomDate, removeObjectPaths, safeJsonParse, safeStableStringify, toBooleanContent, toBooleanContentDeep, toBooleanExplicit, toBooleanLoose, toNumberArrayUnRecursive, toNumberDeep, toStringArrayUnRecursive, toStringDeep, toStringDeepForce };
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ========================================================================
|
|
3
|
+
* @rzl-zone/utils-js
|
|
4
|
+
* ------------------------------------------------------------------------
|
|
5
|
+
* Version: `3.12.1-beta.1`
|
|
6
|
+
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
|
+
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
|
+
* ========================================================================
|
|
9
|
+
*/
|
|
10
|
+
import { A as isPlainObject, C as isSymbol, D as isNaN, E as isNull, F as isBoolean, M as isArray, N as isNil, O as isNumberObject, P as isFunction, S as isUndefined, T as assertIsPlainObject, _ as isBuffer, b as hasOwnProp, f as isSet, g as isStringObject, h as isBooleanObject, j as isObject, k as isString, m as isInfinityNumber, r as getPreciseType, t as assertIsBoolean, v as isError, w as isNumber, x as isObjectOrArray, y as isNonEmptyString } from "./assertIsBoolean-DR1SaXPD.js";
|
|
11
|
+
import { t as isBigInt } from "./isBigInt-DKe0M6hp.js";
|
|
12
|
+
import { t as assertIsArray } from "./assertIsArray-bTA3XLjq.js";
|
|
13
|
+
import { t as assertIsString } from "./assertIsString-CEB07_83.js";
|
|
14
|
+
import { n as isEmptyArray, t as isEmptyObject } from "./isEmptyObject-DCipFwxJ.js";
|
|
15
|
+
import { n as filterNilArray } from "./toStringArrayUnRecursive-DJGtPsFb.js";
|
|
16
|
+
import { n as isDate, r as isMap, t as safeStableStringify } from "./safeStableStringify-CXOZ9Ub8.js";
|
|
17
|
+
import { i as isRegExp, t as isEqual } from "./isEqual-BX49cF9m.js";
|
|
18
|
+
import { t as isEmptyString } from "./isEmptyString-BXzKAC2j.js";
|
|
19
|
+
import { n as isNonEmptyValue, t as isTypedArray } from "./isTypedArray-DuNA8tK6.js";
|
|
20
|
+
function toNumberArrayUnRecursive(array, options = {}) {
|
|
21
|
+
assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
22
|
+
const riv = hasOwnProp(options, "removeInvalidValueNumber") ? options.removeInvalidValueNumber : true;
|
|
23
|
+
assertIsBoolean(riv, { message: ({ currentType, validType }) => `Parameter \`removeInvalidValueNumber\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
24
|
+
if (isArray(array)) {
|
|
25
|
+
const result = Array.from(array, (x) => {
|
|
26
|
+
if (isBigInt(x)) return Number(x);
|
|
27
|
+
const match = String(x).trim().match(/-?\d+(\.\d+)?/);
|
|
28
|
+
return match ? Number(match[0]) : isNull(x) ? null : void 0;
|
|
29
|
+
});
|
|
30
|
+
return riv ? filterNilArray(result) : result;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function toStringDeepForce(value, forceToString) {
|
|
34
|
+
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) throw new TypeError(`Second parameter \`forceToString\` must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${getPreciseType(forceToString)}\`, with value: \`${safeStableStringify(forceToString, { keepUndefined: true })}\`.`);
|
|
35
|
+
if (isNaN(value)) return forceToString === "primitives" || forceToString === "all" ? "NaN" : NaN;
|
|
36
|
+
if (isString(value) || isNumber(value)) return forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
37
|
+
if (isBoolean(value) || isBigInt(value) || isNil(value)) return forceToString === "primitives" || forceToString === "all" ? String(value) : value;
|
|
38
|
+
if (isNumberObject(value) || isBooleanObject(value) || isStringObject(value)) return forceToString === "all" ? value.valueOf().toString() : value;
|
|
39
|
+
if (isSymbol(value)) return forceToString === "all" ? value.toString() : value;
|
|
40
|
+
if (isFunction(value)) return forceToString === "all" ? value.toString() : value;
|
|
41
|
+
if (isArray(value)) return value.map((v) => toStringDeepForce(v, forceToString));
|
|
42
|
+
if (isObjectOrArray(value)) {
|
|
43
|
+
if (isDate(value)) return forceToString === "all" ? value.toISOString() : value;
|
|
44
|
+
if (isRegExp(value)) return forceToString === "all" ? value.toString() : value;
|
|
45
|
+
if (isError(value) || value instanceof Promise) return forceToString === "all" ? value.toString() : value;
|
|
46
|
+
if (isSet(value)) return forceToString === "all" ? [...value].map((v) => toStringDeepForce(v, forceToString)) : value;
|
|
47
|
+
if (isMap(value)) return forceToString === "all" ? [...value.entries()].map(([k, v]) => [toStringDeepForce(k, forceToString), toStringDeepForce(v, forceToString)]) : value;
|
|
48
|
+
const result = {};
|
|
49
|
+
if (isObject(value)) for (const key of Object.keys(value)) result[key] = toStringDeepForce(value[key], forceToString);
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
const dedupeArray = (inputArray, options = {}) => {
|
|
55
|
+
assertIsArray(inputArray, { message: ({ currentType, validType }) => `First parameter (\`inputArray\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.` });
|
|
56
|
+
assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
57
|
+
const flatten = hasOwnProp(options, "flatten") ? options.flatten : false;
|
|
58
|
+
const forceToString = hasOwnProp(options, "forceToString") ? options.forceToString : false;
|
|
59
|
+
if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) throw new TypeError(`Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${getPreciseType(forceToString)}\`, with value: \`${safeStableStringify(forceToString, { keepUndefined: true })}\`.`);
|
|
60
|
+
assertIsBoolean(flatten, { message: ({ currentType, validType }) => `Parameter \`flatten\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
61
|
+
const process = (arr) => {
|
|
62
|
+
const seen = [];
|
|
63
|
+
return arr.reduce((acc, item) => {
|
|
64
|
+
const value = isArray(item) ? process(item) : toStringDeepForce(item, forceToString);
|
|
65
|
+
if (!seen.some((s) => isEqual(s, value))) {
|
|
66
|
+
seen.push(value);
|
|
67
|
+
acc.push(value);
|
|
68
|
+
}
|
|
69
|
+
return acc;
|
|
70
|
+
}, []);
|
|
71
|
+
};
|
|
72
|
+
const deepFlatten = (value) => {
|
|
73
|
+
if (isArray(value)) return value.flatMap(deepFlatten);
|
|
74
|
+
if (isSet(value)) return [...value].flatMap(deepFlatten);
|
|
75
|
+
if (isMap(value)) return [...value.values()].flatMap(deepFlatten);
|
|
76
|
+
return [value];
|
|
77
|
+
};
|
|
78
|
+
return flatten ? process(deepFlatten(inputArray)) : process(inputArray);
|
|
79
|
+
};
|
|
80
|
+
const toBooleanContent = (value) => {
|
|
81
|
+
if (isNil(value)) return false;
|
|
82
|
+
if (isString(value)) return isNonEmptyString(value);
|
|
83
|
+
if (isBoolean(value)) return value;
|
|
84
|
+
if (isNumber(value, { includeNaN: true })) return value !== 0;
|
|
85
|
+
if (isArray(value) || isObject(value)) return isNonEmptyValue(value);
|
|
86
|
+
return Boolean(value);
|
|
87
|
+
};
|
|
88
|
+
const toBooleanContentDeep = (value) => {
|
|
89
|
+
if (isNil(value)) return false;
|
|
90
|
+
if (isString(value)) return isNonEmptyString(value);
|
|
91
|
+
if (isBoolean(value)) return value;
|
|
92
|
+
if (isNumber(value, { includeNaN: true })) return value !== 0;
|
|
93
|
+
if (isArray(value)) return value.some(toBooleanContentDeep);
|
|
94
|
+
if (isObject(value)) return Object.values(value).some(toBooleanContentDeep);
|
|
95
|
+
return false;
|
|
96
|
+
};
|
|
97
|
+
const toBooleanExplicit = (value, options = {}) => {
|
|
98
|
+
if (isNil(value)) return false;
|
|
99
|
+
if (!isPlainObject(options)) options = {};
|
|
100
|
+
const ci = hasOwnProp(options, "caseInsensitive") ? options.caseInsensitive : false;
|
|
101
|
+
const ts = hasOwnProp(options, "trimString") ? options.trimString : true;
|
|
102
|
+
const incInd = hasOwnProp(options, "includeIndeterminate") ? options.includeIndeterminate : false;
|
|
103
|
+
if (!isBoolean(ci) || !isBoolean(ts) || !isBoolean(incInd)) throw new TypeError(`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${getPreciseType(ci)}\`, 'trimString': \`${getPreciseType(ts)}\`, 'includeIndeterminate': \`${getPreciseType(incInd)}\`].`);
|
|
104
|
+
if (isString(value)) {
|
|
105
|
+
let normalized = value;
|
|
106
|
+
if (ts) normalized = normalized.trim();
|
|
107
|
+
if (ci) normalized = normalized.toLowerCase();
|
|
108
|
+
const validTrueStrings = [
|
|
109
|
+
"true",
|
|
110
|
+
"on",
|
|
111
|
+
"yes",
|
|
112
|
+
"1"
|
|
113
|
+
];
|
|
114
|
+
if (incInd) validTrueStrings.push("indeterminate");
|
|
115
|
+
return validTrueStrings.includes(normalized);
|
|
116
|
+
}
|
|
117
|
+
if (isNumber(value)) return value === 1;
|
|
118
|
+
if (isBoolean(value)) return value;
|
|
119
|
+
return false;
|
|
120
|
+
};
|
|
121
|
+
const toBooleanLoose = (value) => {
|
|
122
|
+
if (isNil(value)) return false;
|
|
123
|
+
if (isString(value)) return !isEmptyString(value);
|
|
124
|
+
if (isBoolean(value)) return value;
|
|
125
|
+
if (isNumber(value, { includeNaN: true })) return value !== 0;
|
|
126
|
+
if (isArray(value)) return value.length > 0;
|
|
127
|
+
return Boolean(value);
|
|
128
|
+
};
|
|
129
|
+
const convertType = (value) => {
|
|
130
|
+
const predefinedValues = {
|
|
131
|
+
undefined: void 0,
|
|
132
|
+
null: null,
|
|
133
|
+
nan: NaN,
|
|
134
|
+
true: true,
|
|
135
|
+
false: false,
|
|
136
|
+
yes: true,
|
|
137
|
+
no: false
|
|
138
|
+
};
|
|
139
|
+
if (isString(value)) {
|
|
140
|
+
const normalized = value.trim().toLowerCase();
|
|
141
|
+
if (Object.prototype.hasOwnProperty.call(predefinedValues, normalized)) return predefinedValues[normalized];
|
|
142
|
+
const numericString = normalized.replace(/,/g, "");
|
|
143
|
+
const numberString = Number(numericString);
|
|
144
|
+
if (!isNaN(numberString) && isNonEmptyString(numericString)) return numberString;
|
|
145
|
+
return value.trim();
|
|
146
|
+
}
|
|
147
|
+
return value;
|
|
148
|
+
};
|
|
149
|
+
const deepCloneSafe = (obj) => {
|
|
150
|
+
try {
|
|
151
|
+
if (isFunction(structuredClone)) return structuredClone(obj);
|
|
152
|
+
} catch {}
|
|
153
|
+
return JSON.parse(JSON.stringify(obj));
|
|
154
|
+
};
|
|
155
|
+
const deleteNestedKey = (obj, path) => {
|
|
156
|
+
if (!isObjectOrArray(obj)) return obj;
|
|
157
|
+
const [currentKey, ...rest] = path;
|
|
158
|
+
if (isArray(obj)) {
|
|
159
|
+
for (const item of obj) if (isObjectOrArray(item)) deleteNestedKey(item, path);
|
|
160
|
+
} else if (isEmptyArray(rest) && isPlainObject(obj) && currentKey) delete obj[currentKey];
|
|
161
|
+
else if (isPlainObject(obj) && currentKey && isObjectOrArray(obj[currentKey])) deleteNestedKey(obj[currentKey], rest);
|
|
162
|
+
return obj;
|
|
163
|
+
};
|
|
164
|
+
const deleteExactPathOnce = (obj, path) => {
|
|
165
|
+
if (!isPlainObject(obj)) return obj;
|
|
166
|
+
const [currentKey, ...rest] = path;
|
|
167
|
+
if (rest.length === 0 && currentKey && isPlainObject(obj)) delete obj[currentKey];
|
|
168
|
+
else if (currentKey && isPlainObject(obj[currentKey])) deleteExactPathOnce(obj[currentKey], rest);
|
|
169
|
+
return obj;
|
|
170
|
+
};
|
|
171
|
+
function removeObjectPaths(object, keysToDelete, deepClone = true) {
|
|
172
|
+
if (isEmptyObject(object, { checkSymbols: true })) return {};
|
|
173
|
+
assertIsArray(keysToDelete, { message: ({ currentType, validType }) => `Second parameter (\`keysToDelete\`) must be of type \`${validType}\` with value of { key: string, deep?: boolean } plain-object, but received: \`${currentType}\`, with value: \`${safeStableStringify(keysToDelete, { keepUndefined: true })}\`.` });
|
|
174
|
+
if (!keysToDelete.every((k) => isPlainObject(k) && "key" in k)) throw new TypeError(`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${safeStableStringify(keysToDelete, { keepUndefined: true })}\`.`);
|
|
175
|
+
let result = deepClone ? deepCloneSafe(object) : object;
|
|
176
|
+
for (const { key, deep } of keysToDelete) {
|
|
177
|
+
assertIsString(key, { message: ({ currentType, validType }) => `Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
178
|
+
if (!isUndefined(deep) && !isBoolean(deep)) throw new TypeError(`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) ➔ (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${getPreciseType(deep)}\`.`);
|
|
179
|
+
const path = key.split(".");
|
|
180
|
+
result = deep ? deleteNestedKey(result, path) : deleteExactPathOnce(result, path);
|
|
181
|
+
}
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
function toNumberDeep(input, options = {}) {
|
|
185
|
+
assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
186
|
+
const removeEmptyObjects = hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
187
|
+
const removeEmptyArrays = hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
188
|
+
function _internal(input, options) {
|
|
189
|
+
if (isNil(input) || isRegExp(input)) return void 0;
|
|
190
|
+
const { removeEmptyArrays, removeEmptyObjects, isRoot } = options;
|
|
191
|
+
if (!isBoolean(removeEmptyObjects) || !isBoolean(removeEmptyArrays)) throw new TypeError(`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${getPreciseType(removeEmptyObjects)}\`, 'removeEmptyArrays': \`${getPreciseType(removeEmptyArrays)}\`].`);
|
|
192
|
+
if (isNumber(input) || isBoolean(input) || isNonEmptyString(input)) {
|
|
193
|
+
const num = Number(input);
|
|
194
|
+
return isInfinityNumber(num) || isNaN(num) ? void 0 : num;
|
|
195
|
+
}
|
|
196
|
+
if (isNumberObject(input) || isStringObject(input) || isBooleanObject(input)) {
|
|
197
|
+
const valOf = Number(input.valueOf());
|
|
198
|
+
return isInfinityNumber(valOf) || isNaN(valOf) ? void 0 : valOf;
|
|
199
|
+
}
|
|
200
|
+
if (isDate(input, { skipInvalidDate: true })) try {
|
|
201
|
+
return !isNaN(input.getTime()) ? input.getTime() : 0;
|
|
202
|
+
} catch {
|
|
203
|
+
return 0;
|
|
204
|
+
}
|
|
205
|
+
if (isBuffer(input)) {
|
|
206
|
+
const arr = Array.from(input).map((n) => _internal(n, {
|
|
207
|
+
removeEmptyObjects,
|
|
208
|
+
removeEmptyArrays,
|
|
209
|
+
isRoot: false
|
|
210
|
+
})).filter((item) => !isUndefined(item));
|
|
211
|
+
if (removeEmptyArrays && isEmptyArray(arr)) return void 0;
|
|
212
|
+
return arr;
|
|
213
|
+
}
|
|
214
|
+
if (isTypedArray(input)) if (input instanceof BigInt64Array || input instanceof BigUint64Array) {
|
|
215
|
+
const newArray = Array.from(input).map((item) => _internal(item, {
|
|
216
|
+
removeEmptyObjects,
|
|
217
|
+
removeEmptyArrays,
|
|
218
|
+
isRoot: false
|
|
219
|
+
})).filter((item) => !isUndefined(item));
|
|
220
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
221
|
+
return newArray;
|
|
222
|
+
} else {
|
|
223
|
+
const newArray = Array.from(input).map((item) => _internal(item, {
|
|
224
|
+
removeEmptyObjects,
|
|
225
|
+
removeEmptyArrays,
|
|
226
|
+
isRoot: false
|
|
227
|
+
})).filter((item) => !isUndefined(item));
|
|
228
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
229
|
+
return newArray;
|
|
230
|
+
}
|
|
231
|
+
if (isSet(input)) {
|
|
232
|
+
const newArray = Array.from(input).map((item) => _internal(item, {
|
|
233
|
+
removeEmptyObjects,
|
|
234
|
+
removeEmptyArrays,
|
|
235
|
+
isRoot: false
|
|
236
|
+
})).filter((item) => !isUndefined(item));
|
|
237
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
238
|
+
return newArray;
|
|
239
|
+
}
|
|
240
|
+
if (isMap(input)) {
|
|
241
|
+
let newArray = Array.from(input.entries()).map(([k, v]) => {
|
|
242
|
+
const key = _internal(k, {
|
|
243
|
+
removeEmptyObjects,
|
|
244
|
+
removeEmptyArrays,
|
|
245
|
+
isRoot: false
|
|
246
|
+
});
|
|
247
|
+
const value = _internal(v, {
|
|
248
|
+
removeEmptyObjects,
|
|
249
|
+
removeEmptyArrays,
|
|
250
|
+
isRoot: false
|
|
251
|
+
});
|
|
252
|
+
return !isUndefined(key) && !isUndefined(value) ? [key, value] : void 0;
|
|
253
|
+
}).filter((item) => !isUndefined(item));
|
|
254
|
+
if (removeEmptyArrays) newArray = newArray.filter((v) => !isEmptyArray(v));
|
|
255
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
256
|
+
return newArray;
|
|
257
|
+
}
|
|
258
|
+
if (isArray(input)) {
|
|
259
|
+
const newArray = input.map((item) => _internal(item, {
|
|
260
|
+
removeEmptyObjects,
|
|
261
|
+
removeEmptyArrays,
|
|
262
|
+
isRoot: false
|
|
263
|
+
})).filter((item) => !isUndefined(item));
|
|
264
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
265
|
+
return newArray;
|
|
266
|
+
}
|
|
267
|
+
if (isObject(input)) {
|
|
268
|
+
const newObject = {};
|
|
269
|
+
for (const [key, value] of Object.entries(input)) {
|
|
270
|
+
const convertedValue = _internal(value, {
|
|
271
|
+
removeEmptyObjects,
|
|
272
|
+
removeEmptyArrays,
|
|
273
|
+
isRoot: false
|
|
274
|
+
});
|
|
275
|
+
if (!isUndefined(convertedValue)) newObject[key] = convertedValue;
|
|
276
|
+
}
|
|
277
|
+
if (removeEmptyObjects && isEmptyObject(newObject)) return isRoot ? {} : void 0;
|
|
278
|
+
return newObject;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return _internal(input, {
|
|
282
|
+
removeEmptyObjects,
|
|
283
|
+
removeEmptyArrays,
|
|
284
|
+
isRoot: true
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function toStringDeep(input, options = {}) {
|
|
288
|
+
assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
|
|
289
|
+
const removeEmptyObjects = hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
|
|
290
|
+
const removeEmptyArrays = hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
|
|
291
|
+
function _internal(input, options) {
|
|
292
|
+
if (isNil(input) || isInfinityNumber(input)) return void 0;
|
|
293
|
+
const { removeEmptyArrays, removeEmptyObjects, isRoot } = options;
|
|
294
|
+
if (!isBoolean(removeEmptyObjects) || !isBoolean(removeEmptyArrays)) throw new TypeError(`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${getPreciseType(removeEmptyObjects)}\`, 'removeEmptyArrays': \`${getPreciseType(removeEmptyArrays)}\`].`);
|
|
295
|
+
if (isNumber(input) || isString(input) || isBoolean(input)) return String(input);
|
|
296
|
+
if (isNumberObject(input)) {
|
|
297
|
+
const valOf = input.valueOf();
|
|
298
|
+
return isInfinityNumber(valOf) || isNaN(valOf) ? void 0 : valOf.toString();
|
|
299
|
+
}
|
|
300
|
+
if (isStringObject(input)) return input.valueOf();
|
|
301
|
+
if (isBooleanObject(input)) return input.valueOf().toString();
|
|
302
|
+
if (isDate(input, { skipInvalidDate: true })) try {
|
|
303
|
+
return input.toISOString();
|
|
304
|
+
} catch {
|
|
305
|
+
return input.toString();
|
|
306
|
+
}
|
|
307
|
+
if (isRegExp(input)) return input.toString();
|
|
308
|
+
if (isBuffer(input)) return Array.from(input).map((v) => String(v)).filter((v) => !isUndefined(v));
|
|
309
|
+
if (isTypedArray(input)) if (input instanceof BigInt64Array || input instanceof BigUint64Array) {
|
|
310
|
+
const newArray = Array.from(input).map((item) => _internal(item, {
|
|
311
|
+
removeEmptyObjects,
|
|
312
|
+
removeEmptyArrays,
|
|
313
|
+
isRoot: false
|
|
314
|
+
})).map((v) => String(v)).filter((item) => !isUndefined(item));
|
|
315
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
316
|
+
return newArray;
|
|
317
|
+
} else {
|
|
318
|
+
const newArray = Array.from(input).map((item) => _internal(item, {
|
|
319
|
+
removeEmptyObjects,
|
|
320
|
+
removeEmptyArrays,
|
|
321
|
+
isRoot: false
|
|
322
|
+
})).map((v) => String(v)).filter((item) => !isUndefined(item));
|
|
323
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
324
|
+
return newArray;
|
|
325
|
+
}
|
|
326
|
+
if (isSet(input)) {
|
|
327
|
+
const arr = Array.from(input).map((v) => _internal(v, {
|
|
328
|
+
removeEmptyObjects,
|
|
329
|
+
removeEmptyArrays,
|
|
330
|
+
isRoot: false
|
|
331
|
+
})).filter((v) => !isUndefined(v));
|
|
332
|
+
if (removeEmptyArrays && isEmptyArray(arr)) return void 0;
|
|
333
|
+
return arr;
|
|
334
|
+
}
|
|
335
|
+
if (isMap(input)) {
|
|
336
|
+
const arr = Array.from(input.entries()).map(([k, v]) => [_internal(k, {
|
|
337
|
+
removeEmptyObjects,
|
|
338
|
+
removeEmptyArrays,
|
|
339
|
+
isRoot: false
|
|
340
|
+
}), _internal(v, {
|
|
341
|
+
removeEmptyObjects,
|
|
342
|
+
removeEmptyArrays,
|
|
343
|
+
isRoot: false
|
|
344
|
+
})]).filter(([k, v]) => !isUndefined(k) && !isUndefined(v));
|
|
345
|
+
if (removeEmptyArrays && isEmptyArray(arr)) return void 0;
|
|
346
|
+
return arr;
|
|
347
|
+
}
|
|
348
|
+
if (isArray(input)) {
|
|
349
|
+
let newArray = input.map((item) => _internal(item, {
|
|
350
|
+
removeEmptyObjects,
|
|
351
|
+
removeEmptyArrays,
|
|
352
|
+
isRoot: false
|
|
353
|
+
})).filter((item) => !isUndefined(item));
|
|
354
|
+
if (removeEmptyArrays) newArray = newArray.filter((v) => !(isArray(v) && v.length === 0));
|
|
355
|
+
if (removeEmptyArrays && isEmptyArray(newArray)) return void 0;
|
|
356
|
+
return newArray;
|
|
357
|
+
}
|
|
358
|
+
if (isObject(input)) {
|
|
359
|
+
const newObject = {};
|
|
360
|
+
for (const [key, value] of Object.entries(input)) {
|
|
361
|
+
const convertedValue = _internal(value, {
|
|
362
|
+
removeEmptyObjects,
|
|
363
|
+
removeEmptyArrays,
|
|
364
|
+
isRoot: false
|
|
365
|
+
});
|
|
366
|
+
if (!isUndefined(convertedValue)) newObject[key] = convertedValue;
|
|
367
|
+
else if (isArray(value) && !removeEmptyArrays) newObject[key] = [];
|
|
368
|
+
}
|
|
369
|
+
if (removeEmptyObjects && Object.keys(newObject).length === 0) return isRoot ? {} : void 0;
|
|
370
|
+
return newObject;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return _internal(input, {
|
|
374
|
+
removeEmptyObjects,
|
|
375
|
+
removeEmptyArrays,
|
|
376
|
+
isRoot: true
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
export { toBooleanLoose as a, toBooleanContent as c, toNumberArrayUnRecursive as d, convertType as i, dedupeArray as l, toNumberDeep as n, toBooleanExplicit as o, removeObjectPaths as r, toBooleanContentDeep as s, toStringDeep as t, toStringDeepForce as u };
|
|
380
|
+
//# sourceMappingURL=conversions-BNIh_tCH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversions-BNIh_tCH.js","names":[],"sources":["../src/conversions/arrays/casts/toNumberArrayUnRecursive.ts","../src/conversions/values/toStringDeepForce.ts","../src/conversions/arrays/transforms/dedupeArray.ts","../src/conversions/boolean/toBooleanContent.ts","../src/conversions/boolean/toBooleanContentDeep.ts","../src/conversions/boolean/toBooleanExplicit.ts","../src/conversions/boolean/toBooleanLoose.ts","../src/conversions/data-type/convert.ts","../src/conversions/object/_private/utils/deepCloneSafe.ts","../src/conversions/object/_private/utils/deleteNestedKey.ts","../src/conversions/object/_private/utils/deleteExactPathOnce.ts","../src/conversions/object/removeObjectPaths.ts","../src/conversions/values/toNumberDeep.ts","../src/conversions/values/toStringDeep.ts"],"sourcesContent":["import type {\n NormalizeInputToNumberArrayUnRecursive,\n ToNumberArrayUnRecursiveOptions,\n ToNumberArrayUnRecursiveReturn\n} from \"./toNumberArrayUnRecursive.types\";\n\nimport { isNull } from \"@/predicates/is/isNull\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isBigInt } from \"@/predicates/is/isBigInt\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { filterNilArray } from \"../transforms/filterNilArray\";\n\n/** -------------------------------------------------------\n * * ***Utility: `toNumberArrayUnRecursive`.***\n * -------------------------------------------------------\n * **Converts a flat array of strings, numbers, nulls, or undefineds into numbers.**\n * - **Behavior:**\n * - Only supports **flat arrays** (non-recursive).\n * - Valid inputs: `string`, `number`, `null`, `undefined`.\n * - `BigInt` will be converted to `number`.\n * - Other values ➔ coerced into `undefined`.\n * - Invalid values can be **removed** (`removeInvalidValueNumber: true`) or **kept** (`false`).\n * - **ℹ️ Note:**\n * - *For recursive / nested arrays, use ***`toNumberDeep` utility function*** instead.*\n * @template T - Element type of the input array.\n * @template R - Whether invalid values should be removed (`true`) or kept (`false`).\n * @param {Array<T> | readonly T[] | null | undefined} [array] - The array to convert, returns `undefined` if not an array.\n * @param {ToNumberArrayUnRecursiveOptions<RemoveInvalidValue>} [options] - Options to control transformation behavior, defaults to `{ removeInvalidValueNumber: true }`.\n * @returns {ToNumberArrayUnRecursiveReturn<NormalizeInput<T>, RemoveInvalidValue>} A new array of string representations, with invalid values optionally removed.\n * @example\n * ```ts\n * toNumberArrayUnRecursive(['1', 2, '3']);\n * // ➔ [1, 2, 3]\n * toNumberArrayUnRecursive([1, null, undefined, 'abc']);\n * // ➔ [1]\n * toNumberArrayUnRecursive(['1', null, undefined, 'abc'], {\n * removeInvalidValueNumber: false\n * });\n * // ➔ [1, null, undefined, undefined]\n * toNumberArrayUnRecursive(null); // ➔ undefined\n * toNumberArrayUnRecursive(undefined); // ➔ undefined\n * toNumberArrayUnRecursive(1); // ➔ undefined\n * ```\n */\nexport function toNumberArrayUnRecursive(\n array?: null | undefined,\n options?: ToNumberArrayUnRecursiveOptions<boolean>\n): undefined;\nexport function toNumberArrayUnRecursive(\n array?: Array<never>,\n options?: ToNumberArrayUnRecursiveOptions<boolean>\n): [];\nexport function toNumberArrayUnRecursive<T, R extends boolean = true>(\n array?: Array<T> | readonly T[] | null,\n options?: ToNumberArrayUnRecursiveOptions<R>\n): ToNumberArrayUnRecursiveReturn<NormalizeInputToNumberArrayUnRecursive<T>, R>;\nexport function toNumberArrayUnRecursive<T = unknown>(\n array?: T,\n options?: ToNumberArrayUnRecursiveOptions<boolean>\n): undefined;\nexport function toNumberArrayUnRecursive<T>(\n array?: Array<T> | readonly T[] | null,\n options: ToNumberArrayUnRecursiveOptions<boolean> = {}\n) {\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const riv = hasOwnProp(options, \"removeInvalidValueNumber\")\n ? options.removeInvalidValueNumber\n : true;\n\n assertIsBoolean(riv, {\n message: ({ currentType, validType }) =>\n `Parameter \\`removeInvalidValueNumber\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (isArray(array)) {\n const result = Array.from(array, (x) => {\n if (isBigInt(x)) return Number(x);\n\n const str = String(x).trim();\n const match = str.match(/-?\\d+(\\.\\d+)?/);\n // const match = str.match(/^-?\\d+(\\.\\d+)?$/); // ➔ full string match, stricter\n return match ? Number(match[0]) : isNull(x) ? null : undefined;\n });\n\n return riv ? filterNilArray(result) : result;\n }\n\n return undefined;\n}\n","import { isMap } from \"@/predicates/is/isMap\";\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isSet } from \"@/predicates/is/isSet\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isError } from \"@/predicates/is/isError\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isBigInt } from \"@/predicates/is/isBigInt\";\nimport { isObject } from \"@/predicates/is/isObject\";\nimport { isRegExp } from \"@/predicates/is/isRegExp\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isSymbol } from \"@/predicates/is/isSymbol\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isFunction } from \"@/predicates/is/isFunction\";\nimport { isNumberObject } from \"@/predicates/is/isNumberObject\";\nimport { isStringObject } from \"@/predicates/is/isStringObject\";\nimport { isBooleanObject } from \"@/predicates/is/isBooleanObject\";\nimport { isObjectOrArray } from \"@/predicates/is/isObjectOrArray\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { safeStableStringify } from \"../stringify/safeStableStringify\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `toStringDeepForce`.***\n * ---------------------------------------------\n * **Recursively converts a value into a string based on the `forceToString` options.**\n * - **Rules `forceToString` options:**\n * - `\"stringOrNumber\"`: Converts strings and numbers to strings.\n * - `\"primitives\"`: Converts all primitives (number, string, boolean, bigint, undefined, null, NaN) to strings.\n * - `\"all\"`: Converts everything, including symbols, functions, Dates, RegExp, Maps, Sets, Errors, Promises,\n * boxed primitives box (new Number, new String, new Boolean), and deeply all object properties, to strings.\n * - `false`: Leaves everything unchanged.\n * - **Special behaviors:**\n * - `NaN` ➔ `\"NaN\"` only in `\"primitives\"` or `\"all\"` mode.\n * - `Date` ➔ ISO string only in `\"all\"` mode.\n * - ***Primitives Boxed*** (`new Number`, `new String`, `new Boolean`):\n * - For `new String` we convert everything to string (behavior JS of new String):\n * - `new String(\"hi\")` ➔ `.valueOf()` ➔ `\"hi\"`.\n * - `new String(true)` ➔ `.valueOf()` ➔ `\"true\"`.\n * - For `new Boolean` we convert to boolean (behavior JS of new Boolean) then convert to string:\n * - `new Boolean(true)` ➔ `.valueOf()` ➔ `true` ➔ `true.toString()` ➔ `\"true\"`.\n * - Special behavior JS of new Boolean, return `false` **(convert to string: `\"false\"`)**\n * for `false`, (`0` / `-0`), `\"\"` (empty-string), `null`, `undefined`, `NaN`, otherwise\n * `true` **(convert to string: `\"true\"`)**.\n * - For `new Number`:\n * - `new Number(42)` ➔ `.valueOf()` ➔ `42` ➔ `42.toString()` ➔ `\"42\"`.\n * - `new Number(NaN)` ➔ `.valueOf()` ➔ `NaN` ➔ `NaN.toString()` ➔ `\"NaN\"`.\n * - `new Number(null)` ➔ `.valueOf()` ➔ `0` (`null` is `0` behavior JS of new Number) ➔ `0.toString()` ➔ `\"0\"`.\n * - `new Number(undefined)` ➔ `.valueOf()` ➔ `NaN` ➔ `NaN.toString()` ➔ `\"NaN\"`.\n * - `new Number(Infinity)` ➔ `Infinity` ➔ `Infinity` ➔ `Infinity.toString()` ➔ `\"Infinity\"`.\n * - `new Number(-Infinity)` ➔ `-Infinity` ➔ `-Infinity` ➔ `-Infinity.toString()` ➔ `\"-Infinity\"`.\n * - `RegExp` ➔ Source string (e.g. `/abc/i`) only in `\"all\"` mode.\n * - `Symbol` ➔ `Symbol(description)` string only in `\"all\"` mode.\n * - `Map` ➔ Array of [key, value] pairs with keys/values stringified deeply (only in `\"all\"` mode).\n * - `Set` ➔ Array of values stringified deeply (only in `\"all\"` mode).\n * - `Function` ➔ Source code string (e.g. `\"() => 1\"`) only in `\"all\"` mode.\n * - `Error`, `Promise` ➔ Stringified via `.toString()` only in `\"all\"` mode.\n * @param {*} value\n * * ***The value to process.***\n * - ***Can be anything:***\n * - `primitive`.\n * - `array`.\n * - `object`.\n * - `function`.\n * - `etc`.\n * @param {false | \"stringOrNumber\" | \"primitives\" | \"all\"} forceToString - ***The mode of string conversion.***\n * @returns {unknown} A new value with the conversion applied based on `forceToString`.\n * @example\n * toStringDeepForce(42, \"stringOrNumber\");\n * // ➔ \"42\"\n * toStringDeepForce(true, \"primitives\");\n * // ➔ \"true\"\n * toStringDeepForce(null, \"primitives\");\n * // ➔ \"null\"\n * toStringDeepForce(Symbol(\"x\"), \"all\");\n * // ➔ \"Symbol(x)\"\n * toStringDeepForce(new String(\"hi\"), \"all\");\n * // ➔ \"hi\"\n * toStringDeepForce(new Number(42), \"all\");\n * // ➔ \"42\"\n * toStringDeepForce(new Boolean(true), \"all\");\n * // ➔ \"true\"\n * toStringDeepForce({ a: 1, b: [2, NaN] }, \"primitives\");\n * // ➔ { a: \"1\", b: [\"2\", \"NaN\"] }\n * toStringDeepForce(new Date(\"2025-01-01\"), \"all\");\n * // ➔ \"2025-01-01T00:00:00.000Z\"\n * toStringDeepForce(() => 1, \"all\");\n * // ➔ \"() => 1\"\n * toStringDeepForce(/abc/i, \"all\");\n * // ➔ \"/abc/i\"\n * toStringDeepForce(new Map([[\"a\", 1], [\"b\", 2]]), \"all\");\n * // ➔ [[\"a\", \"1\"], [\"b\", \"2\"]]\n * toStringDeepForce(new Set([1, 2, 3]), \"all\");\n * // ➔ [\"1\", \"2\", \"3\"]\n * toStringDeepForce(new Error(\"Oops\"), \"all\");\n * // ➔ \"Error: Oops\"\n * toStringDeepForce(Promise.resolve(1), \"all\");\n * // ➔ \"[object Promise]\"\n * toStringDeepForce({ func: () => 123 }, \"all\");\n * // ➔ { func: \"() => 123\" }\n * toStringDeepForce([1, \"a\", { b: 2 }], false);\n * // ➔ [1, \"a\", { b: 2 }]\n */\nexport function toStringDeepForce<T>(\n value: unknown,\n forceToString: false | \"stringOrNumber\" | \"primitives\" | \"all\"\n): T;\nexport function toStringDeepForce(\n value: unknown,\n forceToString: false | \"stringOrNumber\" | \"primitives\" | \"all\"\n) {\n if (\n !(\n forceToString === false ||\n forceToString === \"stringOrNumber\" ||\n forceToString === \"primitives\" ||\n forceToString === \"all\"\n )\n ) {\n throw new TypeError(\n `Second parameter \\`forceToString\\` must be of type \\`false\\` or \\`string\\` with value one of \"stringOrNumber\" | \"primitives\" | \"all\", but received: \\`${getPreciseType(\n forceToString\n )}\\`, with value: \\`${safeStableStringify(forceToString, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // NaN special\n if (isNaN(value)) {\n return forceToString === \"primitives\" || forceToString === \"all\"\n ? \"NaN\"\n : NaN;\n }\n\n // string or number\n if (isString(value) || isNumber(value)) {\n return forceToString === \"stringOrNumber\" ||\n forceToString === \"primitives\" ||\n forceToString === \"all\"\n ? String(value)\n : value;\n }\n\n // other primitives\n if (isBoolean(value) || isBigInt(value) || isNil(value)) {\n return forceToString === \"primitives\" || forceToString === \"all\"\n ? String(value)\n : value;\n }\n\n // boxed primitives box (new Number, new String, new Boolean)\n if (\n isNumberObject(value) ||\n isBooleanObject(value) ||\n isStringObject(value)\n ) {\n return forceToString === \"all\" ? value.valueOf().toString() : value;\n }\n\n // symbol\n if (isSymbol(value)) {\n return forceToString === \"all\" ? value.toString() : value;\n }\n\n // function: only convert on \"all\"\n if (isFunction(value)) {\n return forceToString === \"all\" ? value.toString() : value;\n }\n\n // array\n if (isArray(value)) {\n return value.map((v) => toStringDeepForce(v, forceToString));\n }\n\n // objects\n if (isObjectOrArray(value)) {\n if (isDate(value)) {\n return forceToString === \"all\" ? value.toISOString() : value;\n }\n if (isRegExp(value)) {\n return forceToString === \"all\" ? value.toString() : value;\n }\n if (isError(value) || value instanceof Promise) {\n return forceToString === \"all\" ? value.toString() : value;\n }\n\n if (isSet(value)) {\n return forceToString === \"all\"\n ? [...value].map((v) => toStringDeepForce(v, forceToString))\n : value;\n }\n\n if (isMap(value)) {\n return forceToString === \"all\"\n ? [...value.entries()].map(([k, v]) => [\n toStringDeepForce(k, forceToString),\n toStringDeepForce(v, forceToString)\n ])\n : value;\n }\n\n const result: Record<string, unknown> = {};\n if (isObject(value)) {\n for (const key of Object.keys(value)) {\n result[key] = toStringDeepForce(value[key], forceToString);\n }\n }\n return result;\n }\n\n return value;\n}\n","import type {\n DedupeArrayOptions,\n DedupeResult,\n ForceToStringOptions\n} from \"./_private/dedupeArray.types\";\n\nimport { isSet } from \"@/predicates/is/isSet\";\nimport { isMap } from \"@/predicates/is/isMap\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isEqual } from \"@/predicates/is/isEqual\";\n\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsArray } from \"@/assertions/objects/assertIsArray\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { toStringDeepForce } from \"@/conversions/values/toStringDeepForce\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `dedupeArray`.***\n * ---------------------------------------------\n * **Deduplicates values in an array (with optional flattening and deep stringification).**\n * - Supports various modes for converting values to strings before deduplication:\n * - `\"stringOrNumber\"`: Converts strings and numbers to strings.\n * - `\"primitives\"`: Converts all primitives (string, number, boolean, bigint, null, undefined, NaN) to strings.\n * - `\"all\"`: Converts all values (primitives, objects, Maps, Sets, Symbols, RegExp, Dates, Errors, Promises, functions)\n * to strings, including nested object properties.\n * - `false` (default): No conversion applied.\n * - Options:\n * - `forceToString`: Enables string conversion for comparison, default is `false`.\n * - `flatten`: If true, deeply flattens arrays, Maps, and Sets before deduplication, default is `false`.\n * @template ForceToString - `forceToString` mode.\n * @template Flattening - `flatten` mode.\n * @param {unknown[]} inputArray - The array to deduplicate, can be deeply nested and contain any mix of types.\n * @param {DedupeArrayOptions<ForceToString, Flattening>|undefined} [options] - Options to control string conversion.\n * @returns {DedupeResult<ForceToString, Flattening>} Deduplicated array with optional transformations.\n * @throws **{@link TypeError | `TypeError`}** if the input is not an array, or options is not an object, or if `forceToString` is invalid.\n * @example\n * ```ts\n * dedupeArray([\"apple\", \"banana\", \"apple\"]);\n * // ➔ [\"apple\", \"banana\"]\n * dedupeArray([[1, 2], [1, 2]], { flatten: true });\n * // ➔ [1, 2]\n * dedupeArray([new Set([1, 2]), new Set([2, 3])], { flatten: true });\n * // ➔ [1, 2, 3]\n * dedupeArray([1, \"1\", 2, \"2\"], {\n * forceToString: \"stringOrNumber\"\n * }); // ➔ [\"1\", \"2\"]\n * dedupeArray([true, \"true\", false, undefined], {\n * forceToString: \"primitives\"\n * }); // ➔ [\"true\", \"false\", \"undefined\"]\n * dedupeArray([1, \"1\", { a: 1 }], {\n * forceToString: \"all\"\n * }); // ➔ [\"1\", { a: \"1\" }]\n * dedupeArray([1, 1, [2, 2, [3, 3]]]);\n * // ➔ [1, [2, [3]]]\n * dedupeArray([null, undefined, null]);\n * // ➔ [null, undefined]\n * dedupeArray([[], [[]], [[[]]], [[]], [[[]]]]);\n * // ➔ [[], [[]], [[[]]]]\n * const fn = () => 1;\n * dedupeArray([fn, fn, () => 1]);\n * // ➔ [fn, () => 1] cause: ref () => 1 and fn is different but ref const `fn` and `fn` is same ref.\n * dedupeArray([Symbol(\"x\"), Symbol(\"x\")]);\n * // ➔ [Symbol(\"x\")] (symbols are same by identity, so dedupe\n * dedupeArray([NaN, NaN, 1, \"1\"]);\n * // ➔ [NaN, 1, \"1\"]\n * dedupeArray([NaN, NaN, 1, \"1\"], {\n * forceToString: \"primitives\"\n * }); // ➔ [\"NaN\", \"1\"]\n * dedupeArray([new Date(\"2025-01-01\"), new Date(\"2025-01-01\")]);\n * // ➔ [Date(\"2025-01-01\")] (same time, deduped)\n * dedupeArray([new Date(\"2025-01-01\"), new Date(\"2025-01-01\")], {\n * forceToString: \"all\"\n * }); // ➔ [\"2025-01-01T00:00:00.000Z\"]\n * dedupeArray([/abc/, /abc/], {\n * forceToString: \"all\"\n * }); // ➔ [\"/abc/\"]\n * dedupeArray([new Map(), new Set(), new Error(\"err\")], {\n * forceToString: \"all\"\n * }); // ➔ [\"[object Map]\", \"[object Set]\", \"Error: err\"]\n * dedupeArray([Promise.resolve(1), Promise.resolve(1)], {\n * forceToString: \"all\"\n * }); // ➔ [\"[object Promise]\"]\n * dedupeArray([{ a: 1 }, { a: 1 }, { a: 2 }], {\n * forceToString: \"primitives\"\n * }); // ➔ [{ a: \"1\" }, { a: \"2\" }]\n * dedupeArray([{ a: { b: 1 } }, { a: { b: 1 } }], {\n * forceToString: \"all\"\n * }); // ➔ [{ a: { b: \"1\" } }]\n * dedupeArray(\"not an array\");\n * // ➔ Throws TypeError\n * dedupeArray([1, 2, 3], {\n * forceToString: \"invalid\"\n * }); // ➔ Throws TypeError\n * ```\n */\nexport const dedupeArray = <\n ForceToString extends ForceToStringOptions = false,\n Flattening extends boolean = false\n>(\n inputArray: unknown[],\n options: DedupeArrayOptions<ForceToString, Flattening> = {}\n): DedupeResult<ForceToString, Flattening> => {\n assertIsArray(inputArray, {\n message: ({ currentType, validType }) =>\n `First parameter (\\`inputArray\\`) must be of type \\`${validType}\\` (array literal or instance), but received: \\`${currentType}\\`.`\n });\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const flatten = hasOwnProp(options, \"flatten\") ? options.flatten : false;\n const forceToString = hasOwnProp(options, \"forceToString\")\n ? options.forceToString\n : false;\n\n if (\n !(\n forceToString === false ||\n forceToString === \"stringOrNumber\" ||\n forceToString === \"primitives\" ||\n forceToString === \"all\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`forceToString\\` property of the \\`options\\` (second parameter) must be of type \\`false\\` or \\`string\\` with value one of \"stringOrNumber\" | \"primitives\" | \"all\", but received: \\`${getPreciseType(\n forceToString\n )}\\`, with value: \\`${safeStableStringify(forceToString, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n assertIsBoolean(flatten, {\n message: ({ currentType, validType }) =>\n `Parameter \\`flatten\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const process = (arr: unknown[]): unknown[] => {\n const seen: unknown[] = [];\n return arr.reduce<unknown[]>((acc, item) => {\n const value = isArray(item)\n ? process(item)\n : toStringDeepForce(item, forceToString);\n\n if (!seen.some((s) => isEqual(s, value))) {\n seen.push(value);\n acc.push(value);\n }\n return acc;\n }, []);\n };\n\n const deepFlatten = (value: unknown): unknown[] => {\n if (isArray(value)) {\n return value.flatMap(deepFlatten);\n }\n\n if (isSet(value)) {\n return [...value].flatMap(deepFlatten);\n }\n\n if (isMap(value)) {\n return [...value.values()].flatMap(deepFlatten);\n }\n\n return [value];\n };\n\n return (\n flatten ? process(deepFlatten(inputArray)) : process(inputArray)\n ) as DedupeResult<ForceToString, Flattening>;\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isObject } from \"@/predicates/is/isObject\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isNonEmptyValue } from \"@/predicates/is/isNonEmptyValue\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** --------------------------------------------\n * * ***Utility: `toBooleanContent`.***\n * ---------------------------------------------\n * **Converts a given value into a boolean (***strict***).**\n * - **This is stricter than normal JS coercion:**\n * - `null` and `undefined` return `false`.\n * - Empty strings return `false`, non-empty strings return `true`.\n * - Numbers: `0` is `false`, others `true`.\n * - Booleans returned as-is.\n * - Arrays: `[]` is `false`, non-empty is `true`.\n * - Objects: `{}` is `false`, object with keys is `true`.\n * @param {*} value - The value to be converted.\n * @returns {boolean} Return `true` if the value is considered non-empty, otherwise `false`.\n * @example\n * toBooleanContent(null); // ➔ false\n * toBooleanContent(undefined); // ➔ false\n * toBooleanContent(\"\"); // ➔ false\n * toBooleanContent(\" \"); // ➔ false\n * toBooleanContent(\"abc\"); // ➔ true\n * toBooleanContent(\" asd \"); // ➔ true\n * toBooleanContent(0); // ➔ false\n * toBooleanContent(42); // ➔ true\n * toBooleanContent(NaN); // ➔ true\n * toBooleanContent([]); // ➔ false\n * toBooleanContent([1]); // ➔ true\n * toBooleanContent({}); // ➔ false\n * toBooleanContent({ a: 1 }); // ➔ true\n * toBooleanContent({[Symbol(\"key\")]: 123}); // ➔ false\n */\nexport const toBooleanContent = (value: unknown): boolean => {\n if (isNil(value)) return false;\n if (isString(value)) return isNonEmptyString(value);\n if (isBoolean(value)) return value;\n if (isNumber(value, { includeNaN: true })) return value !== 0;\n if (isArray(value) || isObject(value)) return isNonEmptyValue(value);\n return Boolean(value);\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isObject } from \"@/predicates/is/isObject\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** -------------------------------------------------\n * * ***Utility: `toBooleanContentDeep`.***\n * --------------------------------------------------\n * **This function does a deep inspection to determine if the input\n * contains any meaningful / non-empty value.**\n * @description\n * It is stricter than JavaScript's normal truthy checks because it looks *inside*\n * nested arrays & objects (recursively checks).\n * - **Rules:**\n * - `null` and `undefined` return `false`\n * - Empty strings `\"\"` return `false`\n * - `0` returns `false`\n * - Empty arrays `[]` or empty objects `{}` return `false`\n * - Checks deeply nested arrays/objects — if any value inside is \"non-empty\", returns `true`\n * @param {*} value - The value to check.\n * @returns {boolean} Return `true` if the value or anything nested inside is non-empty, otherwise `false`.\n * @example\n * toBooleanContentDeep(null); // ➔ false\n * toBooleanContentDeep(\"\"); // ➔ false\n * toBooleanContentDeep(0); // ➔ false\n * toBooleanContentDeep([]); // ➔ false\n * toBooleanContentDeep({}); // ➔ false\n * toBooleanContentDeep([[], {}]); // ➔ false\n * toBooleanContentDeep(\"abc\"); // ➔ true\n * toBooleanContentDeep(42); // ➔ true\n * toBooleanContentDeep(NaN); // ➔ true\n * toBooleanContentDeep([0, \"\", 5]); // ➔ true\n * toBooleanContentDeep([NaN, \"\", 0]); // ➔ true\n * toBooleanContentDeep([0, \"\", null]); // ➔ false\n * toBooleanContentDeep({ a: 0 }); // ➔ false\n * toBooleanContentDeep({ a: 1 }); // ➔ true\n * toBooleanContentDeep({ a: { b: [] }}); // ➔ false\n * toBooleanContentDeep({ a: { b: \"x\" }}); // ➔ true\n * toBooleanContentDeep({[Symbol(\"key\")]: 123}); // ➔false\n */\nexport const toBooleanContentDeep = (value: unknown): boolean => {\n if (isNil(value)) return false;\n if (isString(value)) return isNonEmptyString(value);\n if (isBoolean(value)) return value;\n if (isNumber(value, { includeNaN: true })) return value !== 0;\n if (isArray(value)) return value.some(toBooleanContentDeep);\n if (isObject(value)) return Object.values(value).some(toBooleanContentDeep);\n\n return false;\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\n\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\ntype ToBooleanExplicitOptions = {\n /** Whether string comparison ignores case, _defaultValue: `false`_.\n *\n * @default false\n */\n caseInsensitive?: boolean;\n /** Whether to trim whitespace before comparison, _defaultValue: `true`_.\n *\n * @default true\n */\n trimString?: boolean;\n /** Whether to consider the string `\"indeterminate\"` as `true`, _defaultValue: `false`_.\n *\n * @default false\n */\n includeIndeterminate?: boolean;\n};\n\n/** --------------------------------------------\n * * ***Utility: `toBooleanExplicit`.***\n * ---------------------------------------------\n * **Converts a value into a strict boolean.**\n * - **Behavior:**\n * - It supports various common string representations of truthy values,\n * including `\"true\"`, `\"on\"`, `\"yes\"`, `\"1\"`, the number `1`, the boolean `true`,\n * and optionally the string `\"indeterminate\"` if enabled.\n * - **ℹ️ Note:**\n * - Any other value, including `undefined`, `null`, `false`, `0`, and\n * unrecognized strings will return `false`.\n * - Supports optional `caseInsensitive` and `trimString` to customize\n * string normalization.\n * @param {*} value - The value to convert.\n * @param {ToBooleanExplicitOptions} [options] - Options for conversion behavior.\n * @param {ToBooleanExplicitOptions[\"caseInsensitive\"]} [options.caseInsensitive=false] - Whether string comparison ignores case, default: `false`.\n * @param {ToBooleanExplicitOptions[\"trimString\"]} [options.trimString=true] - Whether to trim whitespace before comparison, default: `true`.\n * @param {ToBooleanExplicitOptions[\"includeIndeterminate\"]} [options.includeIndeterminate=false] - If `true`, the string `\"indeterminate\"` is considered a truthy value, defaults to `false`.\n * @returns {boolean} Return `true` if the value matches a truthy representation, otherwise `false`.\n * @throws **{@link TypeError | `TypeError`}** if any option provided is not a boolean.\n * @example\n * toBooleanExplicit(1);\n * // ➔ true\n * toBooleanExplicit(true);\n * // ➔ true\n * toBooleanExplicit(\"on\");\n * // ➔ true\n * toBooleanExplicit(\"1\");\n * // ➔ true\n * toBooleanExplicit(0);\n * // ➔ false\n * toBooleanExplicit(\"off\");\n * // ➔ false\n * toBooleanExplicit(\"Yes\");\n * // ➔ false (caseInsensitive is false by default)\n * toBooleanExplicit(\" yes \");\n * // ➔ true (whitespace trimmed by default)\n * toBooleanExplicit(\"YES\", { caseInsensitive: true });\n * // ➔ true\n * toBooleanExplicit(\"YES\", { caseInsensitive: false });\n * // ➔ false\n * toBooleanExplicit(\" YES \", { trimString: false });\n * // ➔ false (whitespace not trimmed)\n * toBooleanExplicit(\" YES \", { trimString: true, caseInsensitive: true });\n * // ➔ true\n * toBooleanExplicit(\" YES \", { trimString: true, caseInsensitive: false });\n * // ➔ false\n * toBooleanExplicit(\"indeterminate\");\n * // ➔ false (default)\n * toBooleanExplicit(\"indeterminate\", { includeIndeterminate: true });\n * // ➔ true\n */\nexport const toBooleanExplicit = (\n value: unknown,\n options: ToBooleanExplicitOptions = {}\n): boolean => {\n if (isNil(value)) return false;\n\n if (!isPlainObject(options)) options = {};\n\n const ci = hasOwnProp(options, \"caseInsensitive\")\n ? options.caseInsensitive\n : false;\n const ts = hasOwnProp(options, \"trimString\") ? options.trimString : true;\n const incInd = hasOwnProp(options, \"includeIndeterminate\")\n ? options.includeIndeterminate\n : false;\n\n if (!isBoolean(ci) || !isBoolean(ts) || !isBoolean(incInd)) {\n throw new TypeError(\n `Parameters \\`caseInsensitive\\`, \\`trimString\\` and \\`includeIndeterminate\\` property of the \\`options\\` (second parameter) expected to be a \\`boolean\\` type, but received: ['caseInsensitive': \\`${getPreciseType(\n ci\n )}\\`, 'trimString': \\`${getPreciseType(\n ts\n )}\\`, 'includeIndeterminate': \\`${getPreciseType(incInd)}\\`].`\n );\n }\n\n if (isString(value)) {\n let normalized = value;\n if (ts) normalized = normalized.trim();\n if (ci) normalized = normalized.toLowerCase();\n\n const validTrueStrings = [\"true\", \"on\", \"yes\", \"1\"];\n if (incInd) validTrueStrings.push(\"indeterminate\");\n\n return validTrueStrings.includes(normalized);\n }\n\n if (isNumber(value)) return value === 1;\n if (isBoolean(value)) return value;\n\n return false;\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\n\n/** --------------------------------------------\n * * ***Utility: `toBooleanLoose`.***\n * ---------------------------------------------\n * **Converts a given value into a boolean (loose).**\n * - **This follows JavaScript's typical truthy/falsy rules with some tweaks:**\n * - `null` and `undefined` return `false`.\n * - Empty strings return `false`, non-empty strings return `true`.\n * - Numbers: `0` is `false`, others `true`.\n * - Booleans returned as-is.\n * - Arrays: `[]` is `false`, non-empty is `true`.\n * - Other objects: uses `Boolean(value)`, so `{}` is `true`.\n * @param {*} value - The value to be converted.\n * @returns {boolean} Return `true` if the value is truthy, otherwise `false`.\n * @example\n * toBooleanLoose(null); // ➔ false\n * toBooleanLoose(\"\"); // ➔ false\n * toBooleanLoose(\"abc\"); // ➔ true\n * toBooleanLoose(0); // ➔ false\n * toBooleanLoose(42); // ➔ true\n * toBooleanLoose([]); // ➔ false\n * toBooleanLoose([1]); // ➔ true\n * toBooleanLoose({}); // ➔ true\n * toBooleanLoose({ a: 1 }); // ➔ true\n */\nexport const toBooleanLoose = (value: unknown): boolean => {\n if (isNil(value)) return false;\n if (isString(value)) return !isEmptyString(value);\n if (isBoolean(value)) return value;\n if (isNumber(value, { includeNaN: true })) return value !== 0;\n if (isArray(value)) return value.length > 0;\n return Boolean(value);\n};\n","import { isNaN } from \"@/predicates/is/isNaN\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `convertType`.***\n * ---------------------------------------------\n * **Converts a value from a string to its corresponding JavaScript primitive type.**\n * - **Supported conversions for string inputs (case-insensitive, trimmed):**\n * - `\"true\"` ➔ `true` (***boolean***).\n * - `\"false\"` ➔ `false` (***boolean***).\n * - `\"null\"` ➔ `null` (***null***).\n * - `\"yes\"` ➔ `true` (***boolean***).\n * - `\"no\"` ➔ `false` (***boolean***).\n * - `\"nan\"` or `\"NaN\"` ➔ `NaN` (***number***).\n * - `\"undefined\"` ➔ `undefined` (***undefined***).\n * - Numeric strings with optional thousands separators (e.g. `\"3,567,890.14\"`) ➔ `3567890.14` ***as a `number` type***.\n * - Strings containing only whitespace are converted to empty string `\"\"`.\n * - Non-string inputs are returned unchanged.\n * - Strings not matching any special case are trimmed and returned as-is.\n * @param {*} value - The value to convert, usually a string or other type.\n * @returns {*} The converted JavaScript primitive (***`boolean`***, ***`number`***, ***`null`***, ***`undefined`***, ***`NaN`***) or the original value if no conversion applies.\n * @example\n * convertType(\"true\"); // ➔ true\n * convertType(\" 42 \"); // ➔ 42\n * convertType(\"FALSE\"); // ➔ false\n * convertType(\" null \"); // ➔ null\n * convertType(\" \"); // ➔ \"\"\n * convertType(\" Hello World \"); // ➔ \"Hello World\"\n * convertType(\"NaN\"); // ➔ NaN\n * convertType(100); // ➔ 100\n * convertType(NaN); // ➔ NaN\n * convertType({}); // ➔ {}\n */\nexport const convertType = (value: unknown): unknown => {\n const predefinedValues: Record<string, unknown> = {\n undefined: undefined,\n null: null,\n nan: NaN,\n true: true,\n false: false,\n yes: true,\n no: false\n };\n\n if (isString(value)) {\n const normalized = value.trim().toLowerCase();\n\n if (Object.prototype.hasOwnProperty.call(predefinedValues, normalized)) {\n return predefinedValues[normalized];\n }\n\n // Support numbers with thousand separators\n const numericString = normalized.replace(/,/g, \"\");\n\n const numberString = Number(numericString);\n if (!isNaN(numberString) && isNonEmptyString(numericString)) {\n return numberString;\n }\n\n return value.trim();\n }\n\n return value;\n};\n","import { isFunction } from \"@/predicates/is/isFunction\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { removeObjectPaths } from \"../../removeObjectPaths\";\n\n/** ***Util helper for {@link removeObjectPaths | `removeObjectPaths`}.***\n *\n * @internal\n */\nexport const deepCloneSafe = <U>(obj: U): U => {\n try {\n if (isFunction(structuredClone)) {\n return structuredClone(obj);\n }\n // eslint-disable-next-line no-empty\n } catch {}\n return JSON.parse(JSON.stringify(obj));\n};\n","import { isArray } from \"@/predicates/is/isArray\";\nimport { isEmptyArray } from \"@/predicates/is/isEmptyArray\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isObjectOrArray } from \"@/predicates/is/isObjectOrArray\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { removeObjectPaths } from \"../../removeObjectPaths\";\n\n/** ***Util helper for {@link removeObjectPaths | `removeObjectPaths`}.***\n *\n * @internal\n */\nexport const deleteNestedKey = <T extends Record<string, unknown> | unknown[]>(\n obj: T,\n path: string[]\n): T => {\n if (!isObjectOrArray(obj)) return obj;\n\n const [currentKey, ...rest] = path;\n\n if (isArray(obj)) {\n for (const item of obj) {\n // recursive pass same path\n if (isObjectOrArray(item)) deleteNestedKey(item, path);\n }\n } else if (isEmptyArray(rest) && isPlainObject(obj) && currentKey) {\n delete obj[currentKey];\n } else if (\n isPlainObject(obj) &&\n currentKey &&\n isObjectOrArray(obj[currentKey])\n ) {\n deleteNestedKey(obj[currentKey], rest);\n }\n\n return obj;\n};\n","import { isPlainObject } from \"@/predicates/is/isPlainObject\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { removeObjectPaths } from \"../../removeObjectPaths\";\n\n/** ***Util helper for {@link removeObjectPaths | `removeObjectPaths`}.***\n *\n * @internal\n */\nexport const deleteExactPathOnce = <T extends Record<string, unknown>>(\n obj: T,\n path: string[]\n): T => {\n if (!isPlainObject(obj)) return obj;\n\n const [currentKey, ...rest] = path;\n\n if (rest.length === 0 && currentKey && isPlainObject(obj)) {\n delete obj[currentKey];\n } else if (currentKey && isPlainObject(obj[currentKey])) {\n deleteExactPathOnce(obj[currentKey], rest);\n }\n\n return obj;\n};\n","import type {\n ConfigRemoveObjectPaths,\n ResultRemoveObjectPaths\n} from \"./_private/removeObjectPaths.types\";\n\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isEmptyObject } from \"@/predicates/is/isEmptyObject\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsArray } from \"@/assertions/objects/assertIsArray\";\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\n\nimport { deepCloneSafe } from \"./_private/utils/deepCloneSafe\";\nimport { deleteNestedKey } from \"./_private/utils/deleteNestedKey\";\nimport { safeStableStringify } from \"../stringify/safeStableStringify\";\nimport { deleteExactPathOnce } from \"./_private/utils/deleteExactPathOnce\";\n\n/** ------------------------------------------------------------------------\n * * ***Utility: `removeObjectPaths`.***\n * ------------------------------------------------------------------------\n * **Deletes multiple keys (shallow or deeply nested) from an object.**\n * - **Features:**\n * - Removes one or more keys from an object based on their paths (supports dot notation for nested properties).\n * - Can delete deeply from all matching nested levels (even inside arrays) when `deep: true`.\n * - By default does **not mutate** the original object. Clones it first.\n * Set `deepClone = false` to mutate in place (useful for performance on large data).\n * - Ensures type safety on `key` paths via `DotPath<T>`, reducing accidental invalid paths.\n * - **Behavior:**\n * - When `deep: false` (default), only deletes the direct property at the specified path.\n * - When `deep: true`, searches deeply and recursively deletes the key from all levels,\n * including inside arrays of objects (applies the *same* path repeatedly).\n * - Skips deletion if the specified path does not exist — no error is thrown.\n * - **Edge Handling:**\n * - If `object` is `null` or not an object, returns an empty object.\n * - If `keysToDelete` is not an array of `{ key, deep? }` objects, throws a `TypeError`.\n * - Ignores invalid intermediate paths (will skip those branches without throwing).\n * @template T - The shape of the input object, used for type-safe dot paths.\n * @param {Record<string, unknown>} object - ***The object to remove keys from, must be an object or will return `{}`.***\n * @param {ConfigRemoveObjectPaths<T>[]} keysToDelete\n * ***An array of instructions:***\n * - `key`: A string path using dot notation (e.g. `\"user.profile.name\"`).\n * - `deep`: If `true`, will recursively remove all instances of the key path at any depth, defaultValue: `false`.\n * @param {boolean|undefined} [deepClone=true]\n * ***Whether to deep clone the original object before modifying.***\n * - `true` (default): returns a *new object* with the specified keys removed.\n * - `false`: modifies the original object in place and returns it.\n * @returns {Partial<T>}\n * - A new object with specified keys removed if `deepClone` is `true`.\n * - The *same mutated object* if `deepClone` is `false`.\n * @throws **{@link TypeError | `TypeError`}** if `keysToDelete` is not an array of `{ key, deep? }` objects.\n * @example\n * // Shallow deletion\n * removeObjectPaths(\n * { a: 1, b: 2, c: { d: 3 } },\n * [{ key: \"b\" }]\n * );\n * // ➔ { a: 1, c: { d: 3 } }\n *\n * // Nested deletion (shallow, removes only exact path)\n * removeObjectPaths(\n * { user: { profile: { name: \"Alice\", age: 30 } } },\n * [{ key: \"user.profile.age\" }]\n * );\n * // ➔ { user: { profile: { name: \"Alice\" } } }\n *\n * // Deep deletion (recursively removes key from all levels and arrays)\n * removeObjectPaths(\n * { items: [{ price: 10 }, { price: 20, details: { price: 30 } }] },\n * [{ key: \"price\", deep: true }]\n * );\n * // ➔ { items: [{}, { details: {} }] }\n *\n * // Without cloning: mutates original object\n * const obj = { x: 1, y: 2 };\n * removeObjectPaths(obj, [{ key: \"y\" }], false);\n * console.log(obj); // ➔ { x: 1 }\n *\n * // No matching path — returns unchanged object\n * removeObjectPaths({}, [{ key: \"a\" }]);\n * // ➔ {}\n *\n * // 🚫 Invalid usage — `keysToDelete` is not an array\n * removeObjectPaths({}, \"a\");\n * // ➔ throws TypeError\n *\n * // 🚫 Invalid usage — missing `key` property in array element\n * removeObjectPaths({}, [{ deep: true }]);\n * // ➔ throws TypeError\n */\nexport function removeObjectPaths<\n T extends Record<string, unknown>,\n K extends ConfigRemoveObjectPaths<T>[]\n>(\n object: T,\n keysToDelete: K,\n deepClone: boolean = true\n): ResultRemoveObjectPaths<T, K> {\n if (isEmptyObject(object, { checkSymbols: true }))\n return {} as ResultRemoveObjectPaths<T, K>;\n\n assertIsArray(keysToDelete, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`keysToDelete\\`) must be of type \\`${validType}\\` with value of { key: string, deep?: boolean } plain-object, but received: \\`${currentType}\\`, with value: \\`${safeStableStringify(\n keysToDelete,\n { keepUndefined: true }\n )}\\`.`\n });\n\n if (!keysToDelete.every((k) => isPlainObject(k) && \"key\" in k)) {\n throw new TypeError(\n `Each element in Second Parameter (\\`keysToDelete\\`) must be of type \\`plain-object\\` with at least a \"key\" property (optionally \"deep\"), but received: \\`${safeStableStringify(\n keysToDelete,\n { keepUndefined: true }\n )}\\`.`\n );\n }\n\n let result = deepClone ? deepCloneSafe(object) : object;\n\n for (const { key, deep } of keysToDelete) {\n assertIsString(key, {\n message: ({ currentType, validType }) =>\n `Parameter \\`key\\` at Second Parameter (\\`keysToDelete\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (!isUndefined(deep) && !isBoolean(deep)) {\n throw new TypeError(\n `Parameter \\`deep\\` at Second Parameter (\\`keysToDelete\\`) ➔ (key: \"${key}\", deep: ${deep}) must be of type \\`boolean\\` or \\`undefined\\`, but received: \\`${getPreciseType(\n deep\n )}\\`.`\n );\n }\n\n const path = key.split(\".\");\n result = deep\n ? deleteNestedKey(result, path)\n : deleteExactPathOnce(result, path);\n }\n\n return result as ResultRemoveObjectPaths<T, K>;\n}\n","import type {\n ConvertedDeepNumber,\n ToNumberDeepOptions\n} from \"./_private/toNumberDeep.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isSet } from \"@/predicates/is/isSet\";\nimport { isMap } from \"@/predicates/is/isMap\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isBuffer } from \"@/predicates/is/isBuffer\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isRegExp } from \"@/predicates/is/isRegExp\";\nimport { isObject } from \"@/predicates/is/isObject\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isEmptyArray } from \"@/predicates/is/isEmptyArray\";\nimport { isTypedArray } from \"@/predicates/is/isTypedArray\";\nimport { isEmptyObject } from \"@/predicates/is/isEmptyObject\";\nimport { isNumberObject } from \"@/predicates/is/isNumberObject\";\nimport { isStringObject } from \"@/predicates/is/isStringObject\";\nimport { isBooleanObject } from \"@/predicates/is/isBooleanObject\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isInfinityNumber } from \"@/predicates/is/isInfinityNumber\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\n/** --------------------------------------------------\n * * ***Utility: `toNumberDeep`.***\n * ---------------------------------------------------\n * **Converts deeply nested arrays, objects, buffers, sets, maps, or typed arrays into numbers while preserving structure.**\n * - **Features:**\n * - Converts numeric strings, number to numbers:\n * - `3.5` ➔ `3.5`.\n * - `\"3.5\"` ➔ `3.5`.\n * - Converts boolean to number:\n * - `true` ➔ `1`.\n * - `false` ➔ `0`.\n * - Converts Date to getTime (timestamp) `Date ➔ number`, if invalid Date value will return `0`:\n * - `new Date(\"invalid\")` ➔ `0`.\n * - `new Date(\"11-09-2025 22:04:11\")` ➔ `1762700651000`.\n * - Converts `Buffer`, `TypedArray`, `Set`, `Map`, and `arrays` recursively to `arrays of numbers`.\n * - Converts boxed primitives box into their primitive equivalents then convert to number:\n * - For `new String` we convert everything to number (behavior JS of new String):\n * - `new String(123)` ➔ `.valueOf()` ➔ `\"123\"` ➔ `Number(\"123\")` ➔ `123`.\n * - `new String(\"123\")` ➔ `.valueOf()` ➔ `\"123\"` ➔ `Number(\"123\")` ➔ `123`.\n * - `new String(true)` ➔ `.valueOf()` ➔ `\"true\"` ➔ `Number(true)` ➔ `1`.\n * - `new String(false)` ➔ `.valueOf()` ➔ `\"false\"` ➔ `Number(false)` ➔ `0`.\n * - If result from `valueOf()` is `NaN` or `Infinity` ***(will removing)***:\n * - `new String(\"hi\")` ➔ `.valueOf()` ➔ `\"hi\"` ➔ `Number(\"hi\")` ➔ `NaN` ***(remove)***.\n * - `new String(()=>{})` ➔ `.valueOf()` ➔ `\"()=>{}\"` ➔ `Number(\"()=>{}\")` ➔ `NaN` ***(remove)***.\n * - For `new Boolean` we convert to boolean (behavior JS of new Boolean) then convert to number:\n * - `new Boolean(true)` ➔ `.valueOf()` ➔ `true` ➔ `Number(true)` ➔ `1`.\n * - `new Boolean(false)` ➔ `.valueOf()` ➔ `false` ➔ `Number(false)` ➔ `0`.\n * - Special behavior JS of new Boolean, return `false` **(convert to number: `0`)**\n * for `false`, (`0` / `-0`), `\"\"` (empty-string),\n * `null`, `undefined`, `NaN`, otherwise `true` **(convert to number: `1`)**.\n * - For `new Number`:\n * - `new Number(42)` ➔ `.valueOf()` ➔ `42`.\n * - `new Number(\"42\")` ➔ `.valueOf()` ➔ `42`.\n * - `new Number(null)` ➔ `.valueOf()` ➔ `0` (`null` is `0` behavior JS of new Number).\n * - If result from `valueOf()` is `NaN` or `Infinity` ***(will removing)***:\n * - `new Number(NaN)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.\n * - `new Number(undefined)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.\n * - `new Number(Infinity)` ➔ `.valueOf()` ➔ `Infinity` ***(remove)***.\n * - `new Number(-Infinity)` ➔ `.valueOf()` ➔ `-Infinity` ***(remove)***.\n * - Recursively processes `nested objects`, `arrays`, `buffers`, `sets`, `maps`, and `typed arrays`.\n * - Removes `empty-string`, `non-numeric strings`.\n * - Removes `null`, `undefined`, `NaN`, `Infinity`, `-Infinity`.\n * - Removes `unsupported` types like `functions` , `RegExp`, `symbols`, and `BigInt`.\n * - Can optionally remove empty arrays (`[]`) and/or empty objects (`{}`) **recursively**.\n * @template T - The input type.\n * @template RemoveEmptyObjects - Whether to remove empty objects.\n * @template RemoveEmptyArrays - Whether to remove empty arrays.\n * @param {*} input - The input value to convert.\n * @param {ToNumberDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays>} [options] - Conversion options.\n * @returns {ConvertedDeepNumber<T, RemoveEmptyObjects, RemoveEmptyArrays>|undefined} The converted value, return `undefined` if the input is entirely empty or filtered out by options.\n * @example\n * ```ts\n * toNumberDeep(\"123\");\n * // ➔ 123\n * toNumberDeep(\"abc\");\n * // ➔ undefined\n * toNumberDeep([NaN, \"10\", \"xyz\"]);\n * // ➔ [10]\n * toNumberDeep({ a: \"1\", b: [null, \"2\"] });\n * // ➔ { a: 1, b: [2] }\n * toNumberDeep(Buffer.from([0, 1, 2]));\n * // ➔ [0, 1, 2]\n * toNumberDeep(new Set([\"1\", \"2\"]));\n * // ➔ [1, 2]\n * toNumberDeep(new Map([[\"a\", \"1\"], [\"b\", \"2\"]]));\n * // ➔ [[\"a\", 1], [\"b\", 2]]\n * toNumberDeep(new Int16Array([1, 2, 3]));\n * // ➔ [1, 2, 3]\n * toNumberDeep(new Date(\"2025-08-16T00:00:00Z\"));\n * // ➔ 1755552000000\n * toNumberDeep({ a: {}, b: [] }, { removeEmptyObjects: true });\n * // ➔ { b: [] }\n * toNumberDeep({ a: {}, b: [] }, { removeEmptyArrays: true });\n * // ➔ { a: {} }\n * toNumberDeep({ x: {}, y: [], z: [{ a: {}, b: [] }] }, {\n * removeEmptyObjects: true, removeEmptyArrays: true\n * });\n * // ➔ { z: [] }\n * ```\n */\nexport function toNumberDeep(\n input?: null | undefined,\n options?: ToNumberDeepOptions<boolean, boolean>\n): undefined;\nexport function toNumberDeep<\n T,\n RemoveEmptyObjects extends boolean = false,\n RemoveEmptyArrays extends boolean = false\n>(\n input: T,\n options?: ToNumberDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays>\n): ConvertedDeepNumber<T, RemoveEmptyObjects, RemoveEmptyArrays>;\nexport function toNumberDeep<\n T,\n RemoveEmptyObjects extends boolean = false,\n RemoveEmptyArrays extends boolean = false\n>(\n input: T,\n options: ToNumberDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays> = {}\n) {\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const removeEmptyObjects = hasOwnProp(options, \"removeEmptyObjects\")\n ? options.removeEmptyObjects\n : false;\n const removeEmptyArrays = hasOwnProp(options, \"removeEmptyArrays\")\n ? options.removeEmptyArrays\n : false;\n\n function _internal<\n T,\n RemoveEmptyObjects extends boolean,\n RemoveEmptyArrays extends boolean\n >(\n input: T,\n options: Required<\n ToNumberDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays>\n > & {\n isRoot: boolean;\n }\n ): unknown {\n if (isNil(input) || isRegExp(input)) return undefined;\n\n const { removeEmptyArrays, removeEmptyObjects, isRoot } = options;\n\n if (!isBoolean(removeEmptyObjects) || !isBoolean(removeEmptyArrays)) {\n throw new TypeError(\n `Parameters \\`removeEmptyObjects\\` and \\`removeEmptyArrays\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\`, but received: ['removeEmptyObjects': \\`${getPreciseType(\n removeEmptyObjects\n )}\\`, 'removeEmptyArrays': \\`${getPreciseType(removeEmptyArrays)}\\`].`\n );\n }\n\n // primitive boolean, numbers, or numeric strings\n if (isNumber(input) || isBoolean(input) || isNonEmptyString(input)) {\n const num = Number(input);\n return isInfinityNumber(num) || isNaN(num) ? undefined : num;\n }\n\n if (\n isNumberObject(input) ||\n isStringObject(input) ||\n isBooleanObject(input)\n ) {\n const valOf = Number(input.valueOf());\n return isInfinityNumber(valOf) || isNaN(valOf) ? undefined : valOf;\n }\n\n if (isDate(input, { skipInvalidDate: true })) {\n try {\n return !isNaN(input.getTime()) ? input.getTime() : 0;\n } catch {\n return 0;\n }\n }\n\n if (isBuffer(input)) {\n const arr = Array.from(input)\n .map((n) =>\n _internal(n, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .filter((item) => !isUndefined(item));\n if (removeEmptyArrays && isEmptyArray(arr)) return undefined;\n return arr;\n }\n\n if (isTypedArray(input)) {\n // If BigInt TypedArray\n if (input instanceof BigInt64Array || input instanceof BigUint64Array) {\n const newArray = Array.from(input)\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .filter((item) => !isUndefined(item));\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n } else {\n // All TypedArray based of number\n const newArray = Array.from(input)\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .filter((item) => !isUndefined(item));\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n }\n }\n\n if (isSet(input)) {\n const newArray = Array.from(input)\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .filter((item) => !isUndefined(item));\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n }\n\n if (isMap(input)) {\n let newArray = Array.from(input.entries())\n .map(([k, v]) => {\n const key = _internal(k, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n });\n const value = _internal(v, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n });\n return !isUndefined(key) && !isUndefined(value)\n ? [key, value]\n : undefined;\n })\n .filter((item) => !isUndefined(item));\n\n // remove empty arrays recursively\n if (removeEmptyArrays) {\n newArray = newArray.filter((v) => !isEmptyArray(v));\n }\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n }\n\n if (isArray(input)) {\n const newArray = input\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .filter((item) => !isUndefined(item));\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n }\n\n if (isObject(input)) {\n const newObject: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(input)) {\n const convertedValue = _internal(value, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n });\n if (!isUndefined(convertedValue)) {\n newObject[key] = convertedValue;\n }\n }\n\n if (removeEmptyObjects && isEmptyObject(newObject)) {\n return isRoot ? {} : undefined;\n }\n\n return newObject;\n }\n\n return undefined;\n }\n\n return _internal(input, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: true\n });\n}\n","import type {\n ConvertedDeepString,\n ToStringDeepOptions\n} from \"./_private/toStringDeep.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isSet } from \"@/predicates/is/isSet\";\nimport { isMap } from \"@/predicates/is/isMap\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isBuffer } from \"@/predicates/is/isBuffer\";\nimport { isObject } from \"@/predicates/is/isObject\";\nimport { isRegExp } from \"@/predicates/is/isRegExp\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isEmptyArray } from \"@/predicates/is/isEmptyArray\";\nimport { isTypedArray } from \"@/predicates/is/isTypedArray\";\nimport { isNumberObject } from \"@/predicates/is/isNumberObject\";\nimport { isStringObject } from \"@/predicates/is/isStringObject\";\nimport { isBooleanObject } from \"@/predicates/is/isBooleanObject\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isInfinityNumber } from \"@/predicates/is/isInfinityNumber\";\n\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\n/** --------------------------------------------------\n * * ***Utility: `toStringDeep`.***\n * ---------------------------------------------------\n * **Converts all values in an array, object, Set, Map, or deeply nested structure to string.**\n * - **Features:**\n * - Converts numbers and strings to string:\n * - `3.5` ➔ `\"3.5\"`.\n * - `\"3.5\"` ➔ `\"3.5\"`.\n * - Converts boolean to string:\n * - `true` ➔ `\"true\"`.\n * - `false` ➔ `\"false\"`.\n * - Converts Date to ISO string (`Date ➔ string`).\n * - Converts RegExp to string (e.g., `/abc/ ➔ \"/abc/\"`).\n * - Converts `Buffer`, `TypedArray`, `Set`, `Map`, and `arrays` recursively to `arrays of strings`.\n * - Converts boxed primitives box into their primitive equivalents then convert to string:\n * - For `new String` we convert everything to string (behavior JS of new String):\n * - `new String(\"hi\")` ➔ `.valueOf()` ➔ `\"hi\"`.\n * - `new String(true)` ➔ `.valueOf()` ➔ `\"true\"`.\n * - For `new Boolean` we convert to boolean (behavior JS of new Boolean) then convert to string:\n * - `new Boolean(true)` ➔ `.valueOf()` ➔ `true` ➔ `true.toString()` ➔ `\"true\"`.\n * - Special behavior JS of new Boolean, return `false` **(convert to string: `\"false\"`)**\n * for `false`, (`0` / `-0`), `\"\"` (empty-string), `null`, `undefined`, `NaN`, otherwise\n * `true` **(convert to string: `\"true\"`)**.\n * - For `new Number`:\n * - `new Number(42)` ➔ `.valueOf()` ➔ `42` ➔ `42.toString()` ➔ `\"42\"`.\n * - `new Number(\"42\")` ➔ `.valueOf()` ➔ `42` ➔ `42.toString()` ➔ `\"42\"`.\n * - `new Number(null)` ➔ `.valueOf()` ➔ `0` (`null` is `0` behavior JS of new Number) ➔ `0.toString()` ➔ `\"0\"`.\n * - If result from `valueOf()` is `NaN` or `Infinity` ***(will removing)***:\n * - `new Number(NaN)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.\n * - `new Number(\"abc\")` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.\n * - `new Number(undefined)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.\n * - `new Number(Infinity)` ➔ `.valueOf()` ➔ `Infinity` ***(remove)***.\n * - `new Number(-Infinity)` ➔ `.valueOf()` ➔ `-Infinity` ***(remove)***.\n * - Recursively processes `nested objects`, `arrays`, `buffers`, `sets`, `maps`, and `typed arrays`.\n * - Removes `null`, `undefined`, `NaN`, `Infinity`, `-Infinity`.\n * - Removes `unsupported` types like `functions`, `symbols`, and `BigInt`.\n * - Can optionally remove empty arrays (`[]`) and/or empty objects (`{}`) **recursively**.\n * @template T - The input data type (`primitive`, `object`, `array`, `Set`, `Map`, or `any nested combination`).\n * @template RemoveEmptyObjects - If `true`, empty objects `{}` will be removed recursively.\n * @template RemoveEmptyArrays - If `true`, empty arrays `[]` will be removed recursively (including arrays nested in `objects` / `arrays` / `Sets` / `Maps`).\n * @param {*} input - The data to convert.\n * @param {ToStringDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays>} [options] - Conversion options.\n * @returns {ConvertedDeepString<T, RemoveEmptyObjects, RemoveEmptyArrays>|undefined}\n * The transformed data, or `undefined` if the entire structure becomes empty after processing.\n * @example\n * ```ts\n * // Simple array conversion\n * toStringDeep([1, \"2\", 3]);\n * // ➔ [\"1\", \"2\", \"3\"]\n *\n * // Simple top-level conversion\n * toStringDeep(123);\n * // ➔ \"123\"\n * toStringDeep(\"123\");\n * // ➔ \"123\"\n * toStringDeep(true);\n * // ➔ \"true\"\n * toStringDeep(false);\n * // ➔ \"false\"\n *\n * // Nested arrays\n * toStringDeep([1, [\"2\", [3, [null, \"4\", true, false]]]]);\n * // ➔ [\"1\", [\"2\", [\"3\", [\"4\", \"true\", \"false\"]]]]\n *\n * // Object with nested values\n * toStringDeep({ a: 1, b: \"2\", c: { d: 3, e: null, f: true, g: false } });\n * // ➔ { a: \"1\", b: \"2\", c: { d: \"3\", f: \"true\", g: \"false\" } }\n *\n * // Removing empty objects\n * toStringDeep({ a: {}, b: \"1\" }, { removeEmptyObjects: true });\n * // ➔ { b: \"1\" }\n *\n * // Removing empty arrays recursively\n * toStringDeep([\"1\", [], { a: [] }], { removeEmptyArrays: true });\n * // ➔ [\"1\", { a: [] }]\n *\n * // Removing both empty objects and arrays recursively\n * toStringDeep({ a: {}, b: [], c: [{ d: {}, e: [] }, \"1\"] }, {\n * removeEmptyObjects: true,\n * removeEmptyArrays: true\n * });\n * // ➔ { c: [\"1\"] }\n *\n * // Fully empty structure becomes undefined\n * toStringDeep([null, undefined, {}], {\n * removeEmptyObjects: true,\n * removeEmptyArrays: true\n * });\n * // ➔ undefined\n * ```\n */\nexport function toStringDeep(\n input?: null | undefined,\n options?: ToStringDeepOptions<boolean, boolean>\n): undefined;\nexport function toStringDeep<\n T,\n RemoveEmptyObjects extends boolean = false,\n RemoveEmptyArrays extends boolean = false\n>(\n input: T,\n options?: ToStringDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays>\n): ConvertedDeepString<T, RemoveEmptyObjects, RemoveEmptyArrays>;\nexport function toStringDeep<\n T,\n RemoveEmptyObjects extends boolean = false,\n RemoveEmptyArrays extends boolean = false\n>(\n input: T,\n options: ToStringDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays> = {}\n) {\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const removeEmptyObjects = hasOwnProp(options, \"removeEmptyObjects\")\n ? options.removeEmptyObjects\n : false;\n const removeEmptyArrays = hasOwnProp(options, \"removeEmptyArrays\")\n ? options.removeEmptyArrays\n : false;\n\n function _internal<\n T,\n RemoveEmptyObjects extends boolean,\n RemoveEmptyArrays extends boolean\n >(\n input: T,\n options: Required<\n ToStringDeepOptions<RemoveEmptyObjects, RemoveEmptyArrays>\n > & {\n isRoot: boolean;\n }\n ): unknown {\n if (isNil(input) || isInfinityNumber(input)) return undefined;\n\n const { removeEmptyArrays, removeEmptyObjects, isRoot } = options;\n\n if (!isBoolean(removeEmptyObjects) || !isBoolean(removeEmptyArrays)) {\n throw new TypeError(\n `Parameters \\`removeEmptyObjects\\` and \\`removeEmptyArrays\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\`, but received: ['removeEmptyObjects': \\`${getPreciseType(\n removeEmptyObjects\n )}\\`, 'removeEmptyArrays': \\`${getPreciseType(removeEmptyArrays)}\\`].`\n );\n }\n\n if (isNumber(input) || isString(input) || isBoolean(input))\n return String(input);\n\n if (isNumberObject(input)) {\n const valOf = input.valueOf();\n return isInfinityNumber(valOf) || isNaN(valOf)\n ? undefined\n : valOf.toString();\n }\n if (isStringObject(input)) return input.valueOf();\n if (isBooleanObject(input)) return input.valueOf().toString();\n\n if (isDate(input, { skipInvalidDate: true })) {\n try {\n return input.toISOString();\n } catch {\n return input.toString();\n }\n }\n\n if (isRegExp(input)) return input.toString();\n\n if (isBuffer(input)) {\n return Array.from(input)\n .map((v) => String(v))\n .filter((v) => !isUndefined(v));\n }\n\n if (isTypedArray(input)) {\n // If BigInt TypedArray\n if (input instanceof BigInt64Array || input instanceof BigUint64Array) {\n const newArray = Array.from(input)\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .map((v) => String(v))\n .filter((item) => !isUndefined(item));\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n } else {\n // All TypedArray based of number\n const newArray = Array.from(input)\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .map((v) => String(v))\n .filter((item) => !isUndefined(item));\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n }\n }\n\n if (isSet(input)) {\n const arr = Array.from(input)\n .map((v) =>\n _internal(v, { removeEmptyObjects, removeEmptyArrays, isRoot: false })\n )\n .filter((v) => !isUndefined(v));\n if (removeEmptyArrays && isEmptyArray(arr)) return undefined;\n return arr;\n }\n\n // Map ➔ array of [key, value]\n if (isMap(input)) {\n const arr = Array.from(input.entries())\n .map(([k, v]) => [\n _internal(k, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n }),\n _internal(v, { removeEmptyObjects, removeEmptyArrays, isRoot: false })\n ])\n .filter(([k, v]) => !isUndefined(k) && !isUndefined(v));\n if (removeEmptyArrays && isEmptyArray(arr)) return undefined;\n return arr;\n }\n\n if (isArray(input)) {\n let newArray = input\n .map((item) =>\n _internal(item, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n })\n )\n .filter((item) => !isUndefined(item));\n\n // remove empty arrays recursively\n if (removeEmptyArrays) {\n newArray = newArray.filter((v) => !(isArray(v) && v.length === 0));\n }\n\n if (removeEmptyArrays && isEmptyArray(newArray)) return undefined;\n return newArray;\n }\n\n if (isObject(input)) {\n const newObject: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(input)) {\n const convertedValue = _internal(value, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: false\n });\n\n if (!isUndefined(convertedValue)) {\n newObject[key] = convertedValue;\n } else if (isArray(value) && !removeEmptyArrays) {\n // preserve empty array property\n newObject[key] = [];\n }\n }\n\n if (removeEmptyObjects && Object.keys(newObject).length === 0) {\n return isRoot ? {} : undefined;\n }\n\n return newObject;\n }\n\n return undefined;\n }\n\n return _internal(input, {\n removeEmptyObjects,\n removeEmptyArrays,\n isRoot: true\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+DA,SAAgB,yBACd,OACA,UAAoD,EAAE,EACtD;CACA,oBAAoB,SAAS,EAC3B,UAAU,EAAE,aAAa,gBACvB,oDAAoD,UAAU,sBAAsB,YAAY,MACnG,CAAC;CAEF,MAAM,MAAM,WAAW,SAAS,2BAA2B,GACvD,QAAQ,2BACR;CAEJ,gBAAgB,KAAK,EACnB,UAAU,EAAE,aAAa,gBACvB,2GAA2G,UAAU,sBAAsB,YAAY,MAC1J,CAAC;CAEF,IAAI,QAAQ,MAAM,EAAE;EAClB,MAAM,SAAS,MAAM,KAAK,QAAQ,MAAM;GACtC,IAAI,SAAS,EAAE,EAAE,OAAO,OAAO,EAAE;GAGjC,MAAM,QADM,OAAO,EAAE,CAAC,MACL,CAAC,MAAM,gBAAgB;GAExC,OAAO,QAAQ,OAAO,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,OAAO;IACrD;EAEF,OAAO,MAAM,eAAe,OAAO,GAAG;;;;;;ACgB1C,SAAgB,kBACd,OACA,eACA;CACA,IACE,EACE,kBAAkB,SAClB,kBAAkB,oBAClB,kBAAkB,gBAClB,kBAAkB,QAGpB,MAAM,IAAI,UACR,yJAAyJ,eACvJ,cACD,CAAC,oBAAoB,oBAAoB,eAAe,EACvD,eAAe,MAChB,CAAC,CAAC,KACJ;CAIH,IAAI,MAAM,MAAM,EACd,OAAO,kBAAkB,gBAAgB,kBAAkB,QACvD,QACA;CAIN,IAAI,SAAS,MAAM,IAAI,SAAS,MAAM,EACpC,OAAO,kBAAkB,oBACvB,kBAAkB,gBAClB,kBAAkB,QAChB,OAAO,MAAM,GACb;CAIN,IAAI,UAAU,MAAM,IAAI,SAAS,MAAM,IAAI,MAAM,MAAM,EACrD,OAAO,kBAAkB,gBAAgB,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