@rzl-zone/utils-js 3.13.1 → 3.14.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/.references/index.d.cts +2 -1
- package/dist/.references/index.d.ts +2 -1
- package/dist/AbortError-DK6kpzbu.cjs +26 -0
- package/dist/AbortError-DK6kpzbu.cjs.map +1 -0
- package/dist/AbortError-DVT8lAKn.js +20 -0
- package/dist/AbortError-DVT8lAKn.js.map +1 -0
- package/dist/{assertIsArray-HgzPQIAM.js → assertIsArray-CG7L7vlt.js} +3 -3
- package/dist/assertIsArray-CG7L7vlt.js.map +1 -0
- package/dist/{assertIsArray-CeXL4xv5.cjs → assertIsArray-CtCRD-_G.cjs} +5 -5
- package/dist/assertIsArray-CtCRD-_G.cjs.map +1 -0
- package/dist/assertIsPlainObject-DPZLj-Ho.cjs +26 -0
- package/dist/assertIsPlainObject-DPZLj-Ho.cjs.map +1 -0
- package/dist/assertIsPlainObject-j9bDqNLo.js +20 -0
- package/dist/assertIsPlainObject-j9bDqNLo.js.map +1 -0
- package/dist/{assertIsString-CY_WkCLr.js → assertIsString-CHIwE12y.js} +4 -4
- package/dist/assertIsString-CHIwE12y.js.map +1 -0
- package/dist/{assertIsString-DUrVt82d.cjs → assertIsString-CjE9kbQ_.cjs} +6 -6
- package/dist/assertIsString-CjE9kbQ_.cjs.map +1 -0
- package/dist/assertions/index.cjs +14 -12
- package/dist/assertions/index.cjs.map +1 -1
- package/dist/assertions/index.d.cts +2 -2
- package/dist/assertions/index.d.ts +2 -2
- package/dist/assertions/index.js +10 -8
- package/dist/assertions/index.js.map +1 -1
- package/dist/conversions/index.cjs +6 -6
- package/dist/conversions/index.d.cts +2 -2
- package/dist/conversions/index.d.ts +2 -2
- package/dist/conversions/index.js +6 -6
- package/dist/conversions-BFz6MKaV.cjs +449 -0
- package/dist/conversions-BFz6MKaV.cjs.map +1 -0
- package/dist/{conversions-1s7xMBe_.js → conversions-Ben5p5Ts.js} +43 -40
- package/dist/conversions-Ben5p5Ts.js.map +1 -0
- package/dist/errors/index.cjs +13 -0
- package/dist/errors/index.d.cts +180 -0
- package/dist/errors/index.d.ts +180 -0
- package/dist/errors/index.js +11 -0
- package/dist/events/index.cjs +10 -9
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.d.cts +185 -100
- package/dist/events/index.d.ts +185 -100
- package/dist/events/index.js +9 -8
- package/dist/events/index.js.map +1 -1
- package/dist/formatter-ekJQF_bA-BepnCBkQ.cjs +67 -0
- package/dist/formatter-ekJQF_bA-BepnCBkQ.cjs.map +1 -0
- package/dist/formatter-ekJQF_bA-xLD9mGk4.js +55 -0
- package/dist/formatter-ekJQF_bA-xLD9mGk4.js.map +1 -0
- package/dist/formatters/index.cjs +2 -2
- package/dist/formatters/index.d.cts +2 -2
- package/dist/formatters/index.d.ts +2 -2
- package/dist/formatters/index.js +2 -2
- package/dist/{formatters-C6cVZBbG.js → formatters-BAbGsnYA.js} +78 -71
- package/dist/formatters-BAbGsnYA.js.map +1 -0
- package/dist/formatters-zd0Gs4Cs.cjs +436 -0
- package/dist/formatters-zd0Gs4Cs.cjs.map +1 -0
- package/dist/generators/index.cjs +37 -31
- package/dist/generators/index.cjs.map +1 -1
- package/dist/generators/index.d.cts +2 -2
- package/dist/generators/index.d.ts +2 -2
- package/dist/generators/index.js +29 -23
- package/dist/generators/index.js.map +1 -1
- package/dist/hasOwnProp-CVIhlD1i.js +47 -0
- package/dist/hasOwnProp-CVIhlD1i.js.map +1 -0
- package/dist/hasOwnProp-D9Tpgokd.cjs +53 -0
- package/dist/hasOwnProp-D9Tpgokd.cjs.map +1 -0
- package/dist/{index-RNQBTK8A.d.cts → index-9JsU_wMu.d.ts} +1375 -937
- package/dist/{index-ORbo-7zA.d.cts → index-BP3sUrAx.d.ts} +242 -133
- package/dist/{index-BG8wdusZ.d.cts → index-BVovC-yK.d.cts} +229 -200
- package/dist/index-C1X6ha9s.d.cts +1041 -0
- package/dist/index-CcPQZ41G.d.cts +1103 -0
- package/dist/index-CjpbuJF4.d.ts +2424 -0
- package/dist/index-CssrQyHh.d.cts +2424 -0
- package/dist/index-DZHiYYR7.d.cts +2179 -0
- package/dist/index-DZHiYYR7.d.ts +2179 -0
- package/dist/index-DlyDmXUo.d.ts +1103 -0
- package/dist/index-Dm4a___O.d.ts +1041 -0
- package/dist/{index-CRz9rSZL.d.ts → index-Dwduk7ez.d.cts} +1375 -937
- package/dist/{index-DPJ-e2JZ.d.ts → index-I5V6RbZM.d.cts} +1592 -790
- package/dist/{index-B5EBAgmC.d.cts → index-hOqBIL7F.d.ts} +1592 -790
- package/dist/{index-B1VQ6USF.d.ts → index-jyuOZMX7.d.ts} +229 -200
- package/dist/{index-ORbo-7zA.d.ts → index-lI0b7iUz.d.cts} +242 -133
- package/dist/{isBigInt-y7s3rsKc.js → isBigInt-Cez32M69.js} +2 -2
- package/dist/isBigInt-Cez32M69.js.map +1 -0
- package/dist/{isBigInt-BVj0M5pq.cjs → isBigInt-YgpNKTbA.cjs} +2 -2
- package/dist/isBigInt-YgpNKTbA.cjs.map +1 -0
- package/dist/{isEmptyString-BYMz_wt9.js → isEmptyString-C9QLWjx2.js} +4 -4
- package/dist/isEmptyString-C9QLWjx2.js.map +1 -0
- package/dist/{isEmptyString-C8PYNPgw.cjs → isEmptyString-O4TFe1Ao.cjs} +5 -5
- package/dist/isEmptyString-O4TFe1Ao.cjs.map +1 -0
- package/dist/isEmptyValue-CFExALXZ.cjs +54 -0
- package/dist/isEmptyValue-CFExALXZ.cjs.map +1 -0
- package/dist/isEmptyValue-kCjnLjbN.js +36 -0
- package/dist/isEmptyValue-kCjnLjbN.js.map +1 -0
- package/dist/{isFinite-DeDaBDr2.cjs → isFinite-B_hHbDpa.cjs} +6 -6
- package/dist/isFinite-B_hHbDpa.cjs.map +1 -0
- package/dist/{isFinite-BEJFOv6B.js → isFinite-ZvNhyHlF.js} +5 -5
- package/dist/isFinite-ZvNhyHlF.js.map +1 -0
- package/dist/{isInteger-DEDbBGez.js → isInteger-aZgzTTZG.js} +4 -4
- package/dist/isInteger-aZgzTTZG.js.map +1 -0
- package/dist/{isInteger-CQLThJOR.cjs → isInteger-dnc6W63Z.cjs} +4 -4
- package/dist/isInteger-dnc6W63Z.cjs.map +1 -0
- package/dist/isNumber-BCWD4dW0.js +20 -0
- package/dist/isNumber-BCWD4dW0.js.map +1 -0
- package/dist/isNumber-BkzwAe50.cjs +26 -0
- package/dist/isNumber-BkzwAe50.cjs.map +1 -0
- package/dist/isPlainObject-CAe_ElKO.d.cts +331 -0
- package/dist/isPlainObject-CJvRG4Je.d.ts +331 -0
- package/dist/{isServer-q3o6cSwD.js → isServer-CQzrX5e0.js} +2 -2
- package/dist/isServer-CQzrX5e0.js.map +1 -0
- package/dist/{isServer-DmycqWsF.cjs → isServer-DhFaedeT.cjs} +2 -2
- package/dist/isServer-DhFaedeT.cjs.map +1 -0
- package/dist/{isEqual-DaPDxMyw.cjs → isTypedArray-DjADSu8q.cjs} +45 -13
- package/dist/isTypedArray-DjADSu8q.cjs.map +1 -0
- package/dist/{isEqual-DM4S_kWh.js → isTypedArray-DxsPKrLh.js} +29 -9
- package/dist/isTypedArray-DxsPKrLh.js.map +1 -0
- package/dist/{isValidDomain-B8Nukgw0.js → isValidDomain-CDtNOhMc.js} +13 -54
- package/dist/isValidDomain-CDtNOhMc.js.map +1 -0
- package/dist/{isValidDomain-ZbyeGOO9.cjs → isValidDomain-D_x7uNIu.cjs} +16 -69
- package/dist/isValidDomain-D_x7uNIu.cjs.map +1 -0
- package/dist/{assertIsBoolean-CWUs-I5l.js → logger-CLWnKRKE.js} +657 -587
- package/dist/logger-CLWnKRKE.js.map +1 -0
- package/dist/{assertIsBoolean-D41HrTB_.cjs → logger-CUacYy3D.cjs} +658 -612
- package/dist/logger-CUacYy3D.cjs.map +1 -0
- package/dist/{noop-BY43WaoU.cjs → noop-CjEbNsJL.cjs} +2 -2
- package/dist/noop-CjEbNsJL.cjs.map +1 -0
- package/dist/{noop-CjY8xVHv.js → noop-qxrcogt5.js} +2 -2
- package/dist/noop-qxrcogt5.js.map +1 -0
- package/dist/{normalizeSpaces-BhZp0U_6.cjs → normalizeSpaces-D0_Z4qnO.cjs} +6 -9
- package/dist/normalizeSpaces-D0_Z4qnO.cjs.map +1 -0
- package/dist/{normalizeSpaces-BoUDtq5P.js → normalizeSpaces-DAsxzBEQ.js} +4 -7
- package/dist/normalizeSpaces-DAsxzBEQ.js.map +1 -0
- package/dist/operations/index.cjs +152 -22
- package/dist/operations/index.cjs.map +1 -1
- package/dist/operations/index.d.cts +257 -35
- package/dist/operations/index.d.ts +257 -35
- package/dist/operations/index.js +142 -13
- package/dist/operations/index.js.map +1 -1
- package/dist/parsers/index.cjs +2 -2
- package/dist/parsers/index.d.cts +238 -180
- package/dist/parsers/index.d.ts +238 -180
- package/dist/parsers/index.js +2 -2
- package/dist/{parsers-B8KYXIjE.js → parsers-BBAE_xVM.js} +9 -8
- package/dist/parsers-BBAE_xVM.js.map +1 -0
- package/dist/{parsers-B_FPX35n.cjs → parsers-i8WEeMJl.cjs} +10 -9
- package/dist/parsers-i8WEeMJl.cjs.map +1 -0
- package/dist/{parsing-Bfaw85Hd.js → parsing-D9tbKQ0v.js} +3 -3
- package/dist/parsing-D9tbKQ0v.js.map +1 -0
- package/dist/{parsing-BCZGco7n.cjs → parsing-DGjB8cwr.cjs} +4 -4
- package/dist/parsing-DGjB8cwr.cjs.map +1 -0
- package/dist/predicates/index.cjs +43 -43
- package/dist/predicates/index.d.cts +3 -3
- package/dist/predicates/index.d.ts +3 -3
- package/dist/predicates/index.js +14 -14
- package/dist/{predicates-KlyOvBSC.js → predicates-C0dova7l.js} +45 -40
- package/dist/predicates-C0dova7l.js.map +1 -0
- package/dist/{predicates-8y28VrbT.cjs → predicates-Dd7To7B4.cjs} +89 -84
- package/dist/predicates-Dd7To7B4.cjs.map +1 -0
- package/dist/promises/index.cjs +27 -26
- package/dist/promises/index.cjs.map +1 -1
- package/dist/promises/index.d.cts +227 -75
- package/dist/promises/index.d.ts +227 -75
- package/dist/promises/index.js +27 -26
- package/dist/promises/index.js.map +1 -1
- package/dist/{punyCode-DnKi0qjS.cjs → punyCode-DHTLhGdD.cjs} +12 -12
- package/dist/punyCode-DHTLhGdD.cjs.map +1 -0
- package/dist/{punyCode-Dwto1RpA.js → punyCode-Deb1Mrkc.js} +12 -12
- package/dist/punyCode-Deb1Mrkc.js.map +1 -0
- package/dist/{removeSpaces--8NW-HSx.js → removeSpaces-BPnsdRN0.js} +4 -4
- package/dist/removeSpaces-BPnsdRN0.js.map +1 -0
- package/dist/{removeSpaces-CmrrkeXz.cjs → removeSpaces-CN3pxBz_.cjs} +7 -7
- package/dist/removeSpaces-CN3pxBz_.cjs.map +1 -0
- package/dist/rzl-utils.global.js +13 -13
- package/dist/safeJsonParse-D1FLVTEM.cjs +209 -0
- package/dist/safeJsonParse-D1FLVTEM.cjs.map +1 -0
- package/dist/{safeJsonParse-OnUwG2El.js → safeJsonParse-DEVKNDSn.js} +29 -28
- package/dist/safeJsonParse-DEVKNDSn.js.map +1 -0
- package/dist/safeStableStringify-C5HHKUdn.cjs +125 -0
- package/dist/safeStableStringify-C5HHKUdn.cjs.map +1 -0
- package/dist/{safeStableStringify-B2KTTS3r.js → safeStableStringify-DfwxmiWn.js} +20 -13
- package/dist/safeStableStringify-DfwxmiWn.js.map +1 -0
- package/dist/strings/index.cjs +26 -30
- package/dist/strings/index.cjs.map +1 -1
- package/dist/strings/index.d.cts +2 -2
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +13 -17
- package/dist/strings/index.js.map +1 -1
- package/dist/tailwind/index.cjs +3 -3
- package/dist/tailwind/index.d.cts +3 -3
- package/dist/tailwind/index.d.ts +3 -3
- package/dist/tailwind/index.js +3 -3
- package/dist/{tailwind-DUuboq52.cjs → tailwind-BG7B0cDs.cjs} +59 -53
- package/dist/tailwind-BG7B0cDs.cjs.map +1 -0
- package/dist/{tailwind-CUdmv-oO.js → tailwind-tJNnFPsF.js} +38 -32
- package/dist/tailwind-tJNnFPsF.js.map +1 -0
- package/dist/{toStringArrayUnRecursive-OOHGazks.js → toStringArrayUnRecursive-D0WbLIRz.js} +9 -9
- package/dist/toStringArrayUnRecursive-D0WbLIRz.js.map +1 -0
- package/dist/toStringArrayUnRecursive-QLoaNX_-.cjs +51 -0
- package/dist/toStringArrayUnRecursive-QLoaNX_-.cjs.map +1 -0
- package/dist/urls/index.cjs +3 -3
- package/dist/urls/index.d.cts +635 -443
- package/dist/urls/index.d.ts +635 -443
- package/dist/urls/index.js +3 -3
- package/dist/{urls-BXT4Krsq.js → urls-EoWslGgg.js} +50 -41
- package/dist/urls-EoWslGgg.js.map +1 -0
- package/dist/urls-NCzPepe2.cjs +308 -0
- package/dist/urls-NCzPepe2.cjs.map +1 -0
- package/package.json +6 -6
- package/dist/assertIsArray-CeXL4xv5.cjs.map +0 -1
- package/dist/assertIsArray-HgzPQIAM.js.map +0 -1
- package/dist/assertIsBoolean-CWUs-I5l.js.map +0 -1
- package/dist/assertIsBoolean-D41HrTB_.cjs.map +0 -1
- package/dist/assertIsString-CY_WkCLr.js.map +0 -1
- package/dist/assertIsString-DUrVt82d.cjs.map +0 -1
- package/dist/conversions-1s7xMBe_.js.map +0 -1
- package/dist/conversions-B3Rf8uId.cjs +0 -446
- package/dist/conversions-B3Rf8uId.cjs.map +0 -1
- package/dist/formatters-C6cVZBbG.js.map +0 -1
- package/dist/formatters-aEAAuzjx.cjs +0 -429
- package/dist/formatters-aEAAuzjx.cjs.map +0 -1
- package/dist/index-CPCt6_Wq.d.cts +0 -765
- package/dist/index-CPCt6_Wq.d.ts +0 -765
- package/dist/index-DBwNa1iO.d.ts +0 -947
- package/dist/index-DPTYOQkn.d.cts +0 -947
- package/dist/index-Dig1fIhZ.d.cts +0 -1716
- package/dist/index-Dig1fIhZ.d.ts +0 -1716
- package/dist/isBigInt-BVj0M5pq.cjs.map +0 -1
- package/dist/isBigInt-y7s3rsKc.js.map +0 -1
- package/dist/isEmptyObject-BsHngDz4.cjs +0 -37
- package/dist/isEmptyObject-BsHngDz4.cjs.map +0 -1
- package/dist/isEmptyObject-DPGR9iPj.js +0 -25
- package/dist/isEmptyObject-DPGR9iPj.js.map +0 -1
- package/dist/isEmptyString-BYMz_wt9.js.map +0 -1
- package/dist/isEmptyString-C8PYNPgw.cjs.map +0 -1
- package/dist/isEmptyValue-BXf7f1jz.cjs +0 -30
- package/dist/isEmptyValue-BXf7f1jz.cjs.map +0 -1
- package/dist/isEmptyValue-D4OHTB3u.js +0 -24
- package/dist/isEmptyValue-D4OHTB3u.js.map +0 -1
- package/dist/isEqual-DM4S_kWh.js.map +0 -1
- package/dist/isEqual-DaPDxMyw.cjs.map +0 -1
- package/dist/isFinite-BEJFOv6B.js.map +0 -1
- package/dist/isFinite-DeDaBDr2.cjs.map +0 -1
- package/dist/isInteger-CQLThJOR.cjs.map +0 -1
- package/dist/isInteger-DEDbBGez.js.map +0 -1
- package/dist/isPlainObject-BwTkj3G0.d.cts +0 -339
- package/dist/isPlainObject-BwTkj3G0.d.ts +0 -339
- package/dist/isServer-DmycqWsF.cjs.map +0 -1
- package/dist/isServer-q3o6cSwD.js.map +0 -1
- package/dist/isTypedArray-BQLbLXsU.cjs +0 -43
- package/dist/isTypedArray-BQLbLXsU.cjs.map +0 -1
- package/dist/isTypedArray-XiBnifLN.js +0 -31
- package/dist/isTypedArray-XiBnifLN.js.map +0 -1
- package/dist/isValidDomain-B8Nukgw0.js.map +0 -1
- package/dist/isValidDomain-ZbyeGOO9.cjs.map +0 -1
- package/dist/noop-BY43WaoU.cjs.map +0 -1
- package/dist/noop-CjY8xVHv.js.map +0 -1
- package/dist/normalizeSpaces-BhZp0U_6.cjs.map +0 -1
- package/dist/normalizeSpaces-BoUDtq5P.js.map +0 -1
- package/dist/parsers-B8KYXIjE.js.map +0 -1
- package/dist/parsers-B_FPX35n.cjs.map +0 -1
- package/dist/parsing-BCZGco7n.cjs.map +0 -1
- package/dist/parsing-Bfaw85Hd.js.map +0 -1
- package/dist/predicates-8y28VrbT.cjs.map +0 -1
- package/dist/predicates-KlyOvBSC.js.map +0 -1
- package/dist/punyCode-DnKi0qjS.cjs.map +0 -1
- package/dist/punyCode-Dwto1RpA.js.map +0 -1
- package/dist/removeSpaces--8NW-HSx.js.map +0 -1
- package/dist/removeSpaces-CmrrkeXz.cjs.map +0 -1
- package/dist/safeJsonParse-OnUwG2El.js.map +0 -1
- package/dist/safeJsonParse-sFqVXf-e.cjs +0 -208
- package/dist/safeJsonParse-sFqVXf-e.cjs.map +0 -1
- package/dist/safeStableStringify-B2KTTS3r.js.map +0 -1
- package/dist/safeStableStringify-Cmi6GyWj.cjs +0 -106
- package/dist/safeStableStringify-Cmi6GyWj.cjs.map +0 -1
- package/dist/tailwind-CUdmv-oO.js.map +0 -1
- package/dist/tailwind-DUuboq52.cjs.map +0 -1
- package/dist/toStringArrayUnRecursive-OOHGazks.js.map +0 -1
- package/dist/toStringArrayUnRecursive-pfk2oP8C.cjs +0 -51
- package/dist/toStringArrayUnRecursive-pfk2oP8C.cjs.map +0 -1
- package/dist/urls-BL9C_yU3.cjs +0 -299
- package/dist/urls-BL9C_yU3.cjs.map +0 -1
- package/dist/urls-BXT4Krsq.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversions-B3Rf8uId.cjs","names":["hasOwnProp","isArray","isBigInt","isNull","filterNilArray","getPreciseType","safeStableStringify","isNaN","isString","isNumber","isBoolean","isBigInt","isNil","isNumberObject","isBooleanObject","isStringObject","isSymbol","isFunction","isArray","isObjectOrArray","isDate","isRegExp","isError","isSet","isMap","isObject","hasOwnProp","getPreciseType","safeStableStringify","isArray","isEqual","isSet","isMap","isNil","isString","isNonEmptyString","isBoolean","isNumber","isArray","isObject","isNonEmptyValue","isNil","isString","isNonEmptyString","isBoolean","isNumber","isArray","isObject","isNil","isPlainObject","hasOwnProp","isBoolean","getPreciseType","isString","isNumber","isNil","isString","isEmptyString","isBoolean","isNumber","isArray","isString","isNaN","isNonEmptyString","isFunction","isObjectOrArray","isArray","isEmptyArray","isPlainObject","isPlainObject","isEmptyObject","safeStableStringify","isPlainObject","isUndefined","isBoolean","getPreciseType","hasOwnProp","isNil","isRegExp","isBoolean","getPreciseType","isNumber","isNonEmptyString","isInfinityNumber","isNaN","isNumberObject","isStringObject","isBooleanObject","isDate","isBuffer","isUndefined","isEmptyArray","isTypedArray","isSet","isMap","isArray","isObject","isEmptyObject","hasOwnProp","isNil","isInfinityNumber","isBoolean","getPreciseType","isNumber","isString","isNumberObject","isNaN","isStringObject","isBooleanObject","isDate","isRegExp","isBuffer","isUndefined","isTypedArray","isEmptyArray","isSet","isMap","isArray","isObject"],"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,CAAC,GACrD;CACA,4CAAoB,SAAS,EAC3B,UAAU,EAAE,aAAa,gBACvB,oDAAoD,UAAU,sBAAsB,YAAY,KACpG,CAAC;CAED,MAAM,MAAMA,mCAAW,SAAS,0BAA0B,IACtD,QAAQ,2BACR;CAEJ,wCAAgB,KAAK,EACnB,UAAU,EAAE,aAAa,gBACvB,2GAA2G,U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ACL,oCAAY,IAAI,CAAC;GAGtC,IAAI,mBACF,WAAW,SAAS,QAAQ,MAAM,EAAEK,gCAAQ,CAAC,KAAK,EAAE,WAAW,EAAE;GAGnE,IAAI,qBAAqBH,mCAAa,QAAQ,GAAG,OAAO;GACxD,OAAO;EACT;EAEA,IAAII,iCAAS,KAAK,GAAG;GACnB,MAAM,YAAqC,CAAC;GAE5C,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;IAChD,MAAM,iBAAiB,UAAU,OAAO;KACtC;KACA;KACA,QAAQ;IACV,CAAC;IAED,IAAI,CAACN,oCAAY,cAAc,GAC7B,UAAU,OAAO;SACZ,IAAIK,gCAAQ,KAAK,KAAK,CAAC,mBAE5B,UAAU,OAAO,CAAC;GAEtB;GAEA,IAAI,sBAAsB,OAAO,KAAK,SAAS,EAAE,WAAW,GAC1D,OAAO,SAAS,CAAC,IAAI;GAGvB,OAAO;EACT;CAGF;CAEA,OAAO,UAAU,OAAO;EACtB;EACA;EACA,QAAQ;CACV,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatters-C6cVZBbG.js","names":["format","formatDns"],"sources":["../src/formatters/currencies/formatCurrency.ts","../src/formatters/numbers/formatNumber.ts","../src/formatters/phones/_private/formatPhoneNumber.utils.ts","../src/formatters/phones/formatPhoneNumber.ts","../src/formatters/strings/_private/censorEmail.utils.ts","../src/formatters/strings/censorEmail.ts","../src/formatters/strings/chunkString.ts","../src/formatters/strings/truncateString.ts","../src/formatters/times/formatDateFns.ts","../src/formatters/times/formatDateIntl.ts","../src/formatters/times/formatDateTime.ts","../src/formatters/times/getGMTOffset.ts"],"sourcesContent":["import type { FormatCurrencyOptions } from \"@/formatters/currencies/formatCurrency.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isFinite } from \"@/predicates/is/isFinite\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isInteger } from \"@/predicates/is/isInteger\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isFunction } from \"@/predicates/is/isFunction\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { parseCurrencyString } from \"@/conversions/currency/parsing\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** ***Util helper for {@link formatCurrency}.***\n *\n * @internal\n */\nconst formatIndianNumber = ({\n numStr,\n separator\n}: {\n numStr?: string;\n separator: string;\n}) => {\n const lastThree = numStr?.slice(-3);\n const rest = numStr?.slice(0, -3);\n if (!rest) return lastThree;\n return (\n rest.replace(/\\B(?=(\\d{2})+(?!\\d))/g, separator) + separator + lastThree\n );\n};\n\n/** -------------------------------------------------------\n * * ***Utility: `formatCurrency`.***\n * -------------------------------------------------------\n * **Formats a number or messy currency string into a\n * beautifully formatted currency string, with highly\n * customizable separators, decimal control, rounding,\n * currency symbols, and negative styling.**\n * - **✅ Highlights:**\n * - ***Accepts:***\n * - Pure numbers: `15300.95`.\n * - Messy currency strings from **any locale**:\n * - `\"Rp 15.000,21\"` ***(Indonesian / Euro)***.\n * - `\"$12,345.60\"` ***(US)***.\n * - `\"CHF 12'345.60\"` ***(Swiss)***.\n * - `\"1,23,456.78\"` ***(Indian)***.\n * - Auto extracts numeric value with smart multi-locale parsing\n * via ***`parseCurrencyString` utility function***.\n * - Strong type checks & clear errors for misconfigured options.\n * - **Handles:**\n * - Thousands separators: `.`, `,`, `'`, ` `.\n * - Decimal separators: `,`, `.`.\n * - Decimal suffix (eg. `\".-\"`, `\" USD\"`).\n * - Currency prefix (eg. `\"Rp \"`, `\"$ \"`).\n * - Rounding: `\"round\"`, `\"ceil\"`, `\"floor\"`, or truncate.\n * - Negative styling: dash `-`, brackets `( )`, absolute, or custom.\n * - **✅ How input is parsed:**\n * - Removes all non-digit except `.`, `,`, `'` and spaces.\n * - Detects bracket negatives: `\"(15.000,10)\"` ➔ `-15000.10`.\n * - Uses last `,` or `.` as decimal separator (others are thousands).\n * - Ignores currency symbols like `Rp`, `$` (must re-apply with `suffixCurrency`).\n * - **ℹ️ Note:**\n * - Always re-apply symbols via `suffixCurrency`.\n * - `parseCurrencyString` smartly detects last decimal,\n * so `\"1.121.234,56\"` and `\"1,121,234.56\"` both parsed correctly.\n * @param {string|number} value\n * ***The input value to format, examples:***\n * - `\"Rp 15.000,21\"`.\n * - `\"$12,345.60\"`.\n * - `\"CHF 12'345.60\"`.\n * - `15300.95`.\n * @param {FormatCurrencyOptions} [options] ***Optional configuration object.***\n * @param {FormatCurrencyOptions[\"separator\"]} [options.separator]\n * ***Thousands separator:***\n * - `{ separator: \".\" }` ➔ `1.000.000`.\n * - *DefaultValue: `\".\"`.*\n * @param {FormatCurrencyOptions[\"separatorDecimals\"]} [options.separatorDecimals]\n * ***Decimal separator:***\n * - `{ separatorDecimals: \",\" }` ➔ `1.000,10`.\n * - *DefaultValue: `\",\"`.*\n * @param {FormatCurrencyOptions[\"suffixCurrency\"]} [options.suffixCurrency]\n * ***Prefix currency string:***\n * - Does **not auto-keep input symbols**.\n * - Must set manually e.g: `{ suffixCurrency: \"Rp \" }`.\n * - `{ suffixCurrency: \"Rp \" }` ➔ `Rp 1.000`.\n * - *DefaultValue: `\"\"`.*\n * @param {FormatCurrencyOptions[\"decimal\"]} [options.decimal]\n * ***Whether to show decimals. If `false`, decimals are truncated:***\n * - If `false`, cut the decimal.\n * - *DefaultValue: `false`.*\n * @param {FormatCurrencyOptions[\"totalDecimal\"]} [options.totalDecimal]\n * ***Total decimal digits:***\n * - If `decimal: true` & `roundedDecimal: false`, simply cuts.\n * - *DefaultValue: `2`.*\n * @param {FormatCurrencyOptions[\"separatorDecimals\"]} [options.suffixDecimal]\n * ***Text appended after decimals:***\n * - E.g: (`\".-\"`, `\" USD\"`).\n * - Example 1: `\".-\"` ➔ `1.000,00.-`.\n * - Example 2: `\" USD\"` ➔ `1.000,00 USD`.\n * - *DefaultValue: `\"\"`.*\n * @param {FormatCurrencyOptions[\"endDecimal\"]} [options.endDecimal]\n * ***Actually append `suffixDecimal`:***\n * - *DefaultValue: `true`.*\n * @param {FormatCurrencyOptions[\"roundedDecimal\"]} [options.roundedDecimal]\n * ***Rounding mode:***\n * - `\"round\"` ➔ nearest.\n * - `\"ceil\"` ➔ always up.\n * - `\"floor\"` ➔ always down.\n * - `false` ➔ truncate.\n * - *DefaultValue: `\"round\"`.*\n * @param {FormatCurrencyOptions[\"negativeFormat\"]} [options.negativeFormat]\n * ***How to format negatives:***\n * - `\"dash\"` ➔ `-15.000`.\n * - `\"brackets\"` ➔ `(15.000)`.\n * - `\"abs\"` ➔ `15.000` (always positive).\n * - Or object: `{ style: \"dash\" | \"brackets\" | \"abs\", space: true | false, custom: (formatted) => string }`.\n * - *DefaultValue: `\"dash\"`.*\n * @param {FormatCurrencyOptions[\"indianFormat\"]} [options.indianFormat]\n * ***Applies Indian Format:***\n * - If `true`, formats as Indian: `12,34,567`.\n * - Also forces `separator: \",\"`, `separatorDecimals: \".\"`.\n * @returns {string}\n * ***Nicely formatted currency string, examples:***\n * - `\"15.000,10\"`.\n * - `\"Rp 15.000,10.-\"`.\n * - `\"15'000.10 USD\"`.\n * - `\"12,34,567.89\"`.\n * @throws **{@link TypeError | `TypeError`}** ***If:***\n * - The `value` is not string or number.\n * - Cannot parse to valid number.\n * - Options have invalid types.\n * @example\n * // --- Number input (default, decimals off) ---\n * formatCurrency(1234567.89);\n * // ➔ \"1.234.567\"\n *\n * // --- Decimals enabled ---\n * formatCurrency(1234567.89, { decimal: true });\n * // ➔ \"1.234.567,89\"\n *\n * // --- Indian format ---\n * formatCurrency(1234567.89, { decimal: true, indianFormat: true });\n * // ➔ \"12,34,567.89\"\n *\n * // --- String input (Indonesian style) ---\n * formatCurrency(\"Rp 15.000,21\", { decimal: true });\n * // ➔ \"15.000,21\"\n *\n * // --- String input (US style) ---\n * formatCurrency(\"$12,345.60\", { decimal: true });\n * // ➔ \"12.345,60\"\n *\n * // --- String input (Swiss style) ---\n * formatCurrency(\"CHF 12'345.60\", { decimal: true });\n * // ➔ \"12'345,60\"\n *\n * // --- String input (Indian style) ---\n * formatCurrency(\"1,23,456.78\", { decimal: true, indianFormat: true });\n * // ➔ \"12,34,567.78\"\n *\n * // --- Negative numbers (dash) ---\n * formatCurrency(-1234.56, { decimal: true });\n * // ➔ \"-1.234,56\"\n *\n * // --- Negative numbers (brackets) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: \"brackets\"\n * });\n * // ➔ \"(1.234,56)\"\n *\n * // --- Negative numbers (custom object style) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: { style: \"brackets\", space: true }\n * });\n * // ➔ \"( 1.234,56 )\"\n *\n * // --- Negative numbers (custom function) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: { custom: (val) => `NEGATIVE[${val}]` }\n * });\n * // ➔ \"NEGATIVE[1.234,56]\"\n *\n * // --- With prefix currency ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixCurrency: \"Rp \"\n * });\n * // ➔ \"Rp 1.234,56\"\n *\n * // --- With suffix decimal ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixDecimal: \".-\"\n * });\n * // ➔ \"1.234,56.-\"\n *\n * // --- With suffix currency + suffix decimal ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixCurrency: \"Rp \",\n * suffixDecimal: \".-\"\n * });\n * // ➔ \"Rp 1.234,56.-\"\n *\n * // --- Custom separators ---\n * formatCurrency(1234567.89, {\n * decimal: true,\n * separator: \"'\",\n * separatorDecimals: \".\"\n * });\n * // ➔ \"1'234'567.89\"\n *\n * // --- Rounding: ceil ---\n * formatCurrency(1234.561, {\n * decimal: true,\n * roundedDecimal: \"ceil\"\n * });\n * // ➔ \"1.234,57\"\n *\n * // --- Rounding: floor ---\n * formatCurrency(1234.569, {\n * decimal: true,\n * roundedDecimal: \"floor\"\n * });\n * // ➔ \"1.234,56\"\n *\n * // --- Rounding: truncate (false) ---\n * formatCurrency(1234.569, {\n * decimal: true,\n * roundedDecimal: false\n * });\n * // ➔ \"1.234,56\"\n *\n * // --- Force no decimals (decimal: false) ---\n * formatCurrency(1234.567, { decimal: false });\n * // ➔ \"1.235\"\n *\n * // --- Edge case: messy input with dots & commas ---\n * formatCurrency(\"1.121.234,561\", {\n * decimal: true,\n * totalDecimal: 2,\n * roundedDecimal: \"ceil\",\n * suffixCurrency: \"Rp \",\n * negativeFormat: { style: \"brackets\" }\n * });\n * // ➔ \"(Rp 1.121.234,57)\"\n *\n * // --- Edge case: integer string input ---\n * formatCurrency(\"1.121.234\", {\n * decimal: true,\n * suffixCurrency: \"Rp \",\n * roundedDecimal: \"ceil\"\n * });\n * // ➔ \"Rp 1.121.234,00\"\n */\nexport const formatCurrency = (\n value: string | number,\n options: FormatCurrencyOptions = {}\n): string => {\n if (!isString(value) && !isFinite(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\` or \\`primitive-number\\`, but received: \\`${getPreciseType(\n value\n )}\\`, with value: \\`${safeStableStringify(value, {\n keepUndefined: true\n })}\\`.`\n );\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 decimal = hasOwnProp(options, \"decimal\") ? options.decimal : false;\n const totalDecimal = hasOwnProp(options, \"totalDecimal\")\n ? options.totalDecimal\n : 2;\n const endDecimal = hasOwnProp(options, \"endDecimal\")\n ? options.endDecimal\n : true;\n const indianFormat = hasOwnProp(options, \"indianFormat\")\n ? options.indianFormat\n : false;\n const suffixCurrency = hasOwnProp(options, \"suffixCurrency\")\n ? options.suffixCurrency\n : \"\";\n const suffixDecimal = hasOwnProp(options, \"suffixDecimal\")\n ? options.suffixDecimal\n : \"\";\n const roundedDecimal = hasOwnProp(options, \"roundedDecimal\")\n ? options.roundedDecimal\n : \"round\";\n const negativeFormat = hasOwnProp(options, \"negativeFormat\")\n ? options.negativeFormat\n : \"dash\";\n let separatorDecimals = hasOwnProp(options, \"separatorDecimals\")\n ? options.separatorDecimals\n : \",\";\n let separator = hasOwnProp(options, \"separator\") ? options.separator : \".\";\n\n // validations\n if (\n !isString(separator) ||\n !isString(separatorDecimals) ||\n !isString(suffixCurrency) ||\n !isString(suffixDecimal)\n ) {\n throw new TypeError(\n `Parameter \\`separator\\`, \\`separatorDecimals\\`, \\`suffixCurrency\\` and \\`suffixDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`string\\`, but received: ['separator': \\`${getPreciseType(\n separator\n )}\\`, 'separatorDecimals': \\`${getPreciseType(\n separatorDecimals\n )}\\`, 'suffixCurrency': \\`${getPreciseType(\n suffixCurrency\n )}\\`, 'suffixDecimal': \\`${getPreciseType(suffixDecimal)}\\`].`\n );\n }\n\n if (\n !isBoolean(decimal) ||\n !isBoolean(endDecimal) ||\n !isBoolean(indianFormat)\n ) {\n throw new TypeError(\n `Parameter \\`decimal\\`, \\`endDecimal\\` and \\`indianFormat\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\`, but received: ['decimal': \\`${getPreciseType(\n decimal\n )}\\`, 'endDecimal': \\`${getPreciseType(\n endDecimal\n )}\\`, 'indianFormat': \\`${getPreciseType(indianFormat)}\\`].`\n );\n }\n\n if (!isInteger(totalDecimal)) {\n throw new TypeError(\n `Parameter \\`totalDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n totalDecimal\n )}\\`, with value: \\`${safeStableStringify(length, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (\n !(\n roundedDecimal === false ||\n roundedDecimal === \"round\" ||\n roundedDecimal === \"ceil\" ||\n roundedDecimal === \"floor\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`roundedDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`false\\` or \\`string\\` must be one of \"round\" | \"ceil\" | \"floor\", but received: \\`${getPreciseType(\n roundedDecimal\n )}\\`, with value: \\`${safeStableStringify(roundedDecimal, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (\n !(\n negativeFormat === \"abs\" ||\n negativeFormat === \"brackets\" ||\n negativeFormat === \"dash\" ||\n isPlainObject(negativeFormat)\n )\n ) {\n throw new TypeError(\n `Parameter \\`negativeFormat\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` must be one of \"abs\" | \"brackets\" | \"dash\" or \\`plain-object\\` type, but received: \\`${getPreciseType(\n negativeFormat\n )}\\`, with value: \\`${safeStableStringify(negativeFormat, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // parse number\n const rawNum = isString(value) ? parseCurrencyString(value) : value;\n if (isNaN(rawNum)) {\n throw new TypeError(\n \"First parameter (`value`) could not be parsed into a valid `number`.\"\n );\n }\n\n let integerPart: string | undefined;\n let decimalPartRaw: string | undefined;\n let num = Math.abs(rawNum);\n const factor = Math.pow(10, totalDecimal);\n\n if (roundedDecimal) {\n const scaled = num * factor;\n switch (roundedDecimal) {\n case \"round\":\n num = Math.round(scaled) / factor;\n break;\n case \"ceil\":\n num = Math.ceil(scaled) / factor;\n break;\n case \"floor\":\n num = Math.floor(scaled) / factor;\n break;\n }\n }\n\n if (roundedDecimal) {\n [integerPart, decimalPartRaw] = num.toFixed(totalDecimal).split(\".\");\n decimalPartRaw = decimalPartRaw ?? \"\".padEnd(totalDecimal, \"0\");\n } else {\n // cut decimal manually\n const split = String(num).split(\".\");\n integerPart = split[0];\n decimalPartRaw = (split[1] || \"\")\n .slice(0, totalDecimal)\n .padEnd(totalDecimal, \"0\");\n }\n\n let formattedInteger: string;\n\n if (indianFormat) {\n separator = \",\";\n separatorDecimals = \".\";\n formattedInteger =\n (suffixCurrency.trim().length ? suffixCurrency : \"\") +\n formatIndianNumber({ numStr: integerPart, separator });\n } else {\n formattedInteger =\n (suffixCurrency.trim().length ? suffixCurrency : \"\") +\n integerPart?.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator);\n }\n\n if (decimal && !isUndefined(decimalPartRaw) && totalDecimal > 0) {\n let formattedDecimal = separatorDecimals + decimalPartRaw;\n if (endDecimal) formattedDecimal += suffixDecimal;\n formattedInteger += formattedDecimal;\n }\n\n // negative format\n if (rawNum < 0) {\n if (negativeFormat === \"dash\") {\n formattedInteger = \"-\" + formattedInteger;\n } else if (negativeFormat === \"brackets\") {\n formattedInteger = \"(\" + formattedInteger + \")\";\n } else if (negativeFormat === \"abs\") {\n // no sign\n } else if (isPlainObject(negativeFormat)) {\n if (hasOwnProp(negativeFormat, \"custom\")) {\n const formatCustomNegative = negativeFormat.custom;\n\n if (!isFunction(formatCustomNegative)) {\n throw new TypeError(\n `Parameter \\`negativeFormat.custom\\` property of the \\`options\\` (second parameter) must be of type function: \\`(formatted: string) => string\\`, but received: \\`${getPreciseType(\n formatCustomNegative\n )}\\`.`\n );\n }\n\n const result = formatCustomNegative(formattedInteger);\n\n assertIsString(result, {\n message: ({ currentType, validType }) =>\n `Parameter \\`negativeFormat.custom\\` property of the \\`options\\` (second parameter) expected return a \\`${validType}\\` type value, but received: \\`${currentType}\\`.`\n });\n\n formattedInteger = result;\n } else {\n const formatStyleNegative = negativeFormat.style || \"dash\";\n const formatSpaceNegative = !isUndefined(negativeFormat.space)\n ? negativeFormat.space\n : false;\n\n assertIsBoolean(formatSpaceNegative, {\n message: ({ currentType, validType }) =>\n `Parameter \\`negativeFormat.space\\` property of the \\`options\\` (second parameter) must be of type \\`${validType} or undefined\\`, but received: \\`${currentType}\\`.`\n });\n\n if (\n !(\n formatStyleNegative === \"abs\" ||\n formatStyleNegative === \"brackets\" ||\n formatStyleNegative === \"dash\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`negativeFormat.style\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` must be of type \"abs\" | \"brackets\" | \"dash\", but received: \\`${getPreciseType(\n formatStyleNegative\n )}\\`, with value: \\`${safeStableStringify(formatStyleNegative, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n switch (formatStyleNegative) {\n case \"dash\":\n formattedInteger =\n \"-\" + (formatSpaceNegative ? \" \" : \"\") + formattedInteger;\n break;\n case \"brackets\":\n formattedInteger = formatSpaceNegative\n ? `( ${formattedInteger} )`\n : `(${formattedInteger})`;\n break;\n case \"abs\":\n // no sign\n break;\n }\n }\n }\n }\n\n return formattedInteger;\n};\n","import { isFinite } from \"@/predicates/is/isFinite\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatNumber`.***\n * ----------------------------------------------------------\n * **Formats a number or numeric string by adding a custom separator\n * every three digits (thousands separator), and intelligently flips\n * the decimal separator according to the chosen separator.**\n * - **Features:**\n * - Converts a number to string before formatting.\n * - Defaults to using `,` as the thousands separator.\n * - If `.` is used as the separator, the decimal will automatically\n * become `,`, and vice versa.\n * - Handles input with existing formatting (e.g. \"1,234,567.89\") and normalizes it.\n * - Supports custom separators, including spaces.\n * - Preserves decimals even if more than 2 digits.\n * @param {string | number} value - The numeric value or string to format, can be plain numbers, or already formatted strings like `\"1,234,567.89\"`.\n * @param {string} [separator=\",\"] - The thousands separator to use, examples: `\",\"` ***(default)***, `\".\"`, `\" \"`, etc.\n * @returns {string} The formatted string with thousands separators and\n * appropriate decimal separator.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not a string or number, or `separator` is not a string.\n * @example\n * formatNumber(1000000);\n * // ➔ \"1,000,000\"\n * formatNumber(\"987654321\");\n * // ➔ \"987,654,321\"\n * formatNumber(1234567.89);\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1234567,89\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1234567.892\");\n * // ➔ \"1,234,567.892\"\n * formatNumber(\"1234567.89\", \".\");\n * // ➔ \"1.234.567,89\"\n * formatNumber(\"1234567,89\", \",\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"987654321\", \" \");\n * // ➔ \"987 654 321\"\n * formatNumber(\"1,234,567.89\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1.234.567,89\", \",\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1.234.567,893\", \".\");\n * // ➔ \"1.234.567,893\"\n * formatNumber(\"1234.56\", \".\");\n * // ➔ \"1.234,56\"\n * formatNumber(\"1234,56\", \",\");\n * // ➔ \"1,234.56\"\n */\nexport const formatNumber = (\n value: string | number,\n separator: string = \",\"\n): string => {\n if (!isString(value) && !isFinite(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\` or \\`primitive number\\`, but received: \\`${getPreciseType(\n value\n )}\\`.`\n );\n }\n\n if (!isString(separator)) {\n throw new TypeError(\n `Second parameter (\\`separator\\`) must be of type \\`string\\` or empty as \\`undefined\\`, but received: \\`${getPreciseType(\n separator\n )}\\`.`\n );\n }\n\n separator = isString(separator) ? separator : \",\";\n const decimalSeparator =\n separator === \".\" ? \",\" : separator === \",\" ? \".\" : \".\";\n\n // Convert value to string\n const stringValue = value.toString().trim();\n\n // --- Normalize input ---\n // Find the last decimal separator from the end\n const lastDot = stringValue.lastIndexOf(\".\");\n const lastComma = stringValue.lastIndexOf(\",\");\n\n let actualDecimal = \"\";\n if (lastDot > lastComma) {\n actualDecimal = \".\";\n } else if (lastComma > lastDot) {\n actualDecimal = \",\";\n }\n\n // Split into integer and decimal parts\n let integerPart = stringValue;\n let decimalPart: string | undefined;\n\n if (actualDecimal) {\n const parts = stringValue.split(actualDecimal);\n integerPart = parts.slice(0, -1).join(actualDecimal); // merge if more than one\n decimalPart = parts.slice(-1)[0];\n }\n\n // Remove all non-digit characters from the integer part\n integerPart = integerPart.replace(/[^\\d]/g, \"\");\n\n // Format integer part with thousands separator\n const formattedInteger = integerPart.replace(\n /\\B(?=(\\d{3})+(?!\\d))/g,\n separator\n );\n\n // Combine with decimal part if exists\n return decimalPart\n ? `${formattedInteger}${decimalSeparator}${decimalPart}`\n : formattedInteger;\n};\n","import type { OmitStrict, Prettify } from \"@rzl-zone/ts-types-plus\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { formatPhoneNumber } from \"../formatPhoneNumber\";\nimport {\n AsYouType,\n type PhoneNumber,\n type CountryCode\n} from \"libphonenumber-js/max\";\n\n/** ***Util constants `country code for special leading zero rule` for {@link formatPhoneNumber}.***\n *\n * @internal\n */\nexport const trunkZeroCountries: Record<string, string> = {\n \"7\": \"Russia, Kazakhstan\",\n \"20\": \"Egypt\",\n \"27\": \"South Africa\",\n \"30\": \"Greece\",\n \"31\": \"Netherlands\",\n \"32\": \"Belgium\",\n \"33\": \"France\",\n \"34\": \"Spain\",\n \"36\": \"Hungary\",\n \"39\": \"Italy, San Marino, Vatican\",\n \"41\": \"Switzerland\",\n \"43\": \"Austria\",\n \"44\": \"United Kingdom\",\n \"45\": \"Denmark\",\n \"46\": \"Sweden\",\n \"47\": \"Norway\",\n \"48\": \"Poland\",\n \"49\": \"Germany\",\n \"51\": \"Peru\",\n \"52\": \"Mexico\",\n \"53\": \"Cuba\",\n \"54\": \"Argentina\",\n \"55\": \"Brazil\",\n \"56\": \"Chile\",\n \"57\": \"Colombia\",\n \"58\": \"Venezuela\",\n \"60\": \"Malaysia\",\n \"61\": \"Australia\",\n \"62\": \"Indonesia\",\n \"63\": \"Philippines\",\n \"64\": \"New Zealand\",\n \"65\": \"Singapore\",\n \"66\": \"Thailand\",\n \"81\": \"Japan\",\n \"82\": \"South Korea\",\n \"84\": \"Vietnam\",\n \"86\": \"China\",\n \"90\": \"Turkey\",\n \"91\": \"India\",\n \"92\": \"Pakistan\",\n \"351\": \"Portugal\",\n \"352\": \"Luxembourg\",\n \"355\": \"Albania\",\n \"356\": \"Malta\",\n \"358\": \"Finland\",\n \"359\": \"Bulgaria\",\n \"370\": \"Lithuania\",\n \"371\": \"Latvia\",\n \"372\": \"Estonia\",\n \"373\": \"Moldova\",\n \"374\": \"Armenia\",\n \"375\": \"Belarus\",\n \"376\": \"Andorra\",\n \"377\": \"Monaco\",\n \"378\": \"San Marino\",\n \"379\": \"Vatican\",\n \"971\": \"UAE\"\n};\n/** ***Util helper for {@link formatPhoneNumber}.***\n *\n * @internal\n */\nexport const isValidPhoneE164 = (value: unknown) => {\n if (!isNonEmptyString(value)) return false;\n return (\n /^(\\+)?[0-9\\s().-]+$/.test(value) && value.replace(/\\D/g, \"\").length <= 15\n );\n};\n\n/** ***Util parsing `phone-number` for {@link formatPhoneNumber}.***\n *\n * @internal\n */\nexport const parsingAsYouType = (\n value: string,\n defaultCountry?: CountryCode\n) => {\n let parsed;\n try {\n parsed = new AsYouType(defaultCountry);\n parsed.input(value);\n return parsed;\n } catch {\n parsed?.reset();\n return undefined;\n }\n};\n\ntype ValidParseAsYouType = Prettify<\n OmitStrict<AsYouType, \"getNumber\"> & {\n getNumber(): PhoneNumber; // override agar tidak nullable\n }\n>;\n\n/** ***Util validation parsing `phone-number` when using `AsYouType` for {@link formatPhoneNumber}.***\n *\n * @internal\n */\nexport const isValidParseAsYouType = (\n parsedAsYouType?: AsYouType\n): parsedAsYouType is ValidParseAsYouType => {\n const parsed = !!parsedAsYouType?.isValid() && !!parsedAsYouType.getNumber();\n return parsed;\n};\n","import type {\n FormatPhoneNumberMain,\n FormatPhoneNumberTakeNumberOnly,\n FormatPhoneNumberCheckValidOnly,\n FormatPhoneNumberTransform,\n ValueFormatPhoneNumber,\n FormatPhoneNumberAllPassing,\n FormatPhoneNumberAllPassingValidOnly,\n FormatPhoneNumberAllPassingTakeOnly,\n OutputFormat\n} from \"./_private/formatPhoneNumber.types\";\n\nimport { isSupportedCountry } from \"libphonenumber-js/max\";\n\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport {\n parsingAsYouType,\n isValidParseAsYouType\n} from \"./_private/formatPhoneNumber.utils\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Formatting Number`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`):\n * - Return empty-string (\"\"), if invalid number phone.\n * - Return boolean when **validity-check mode** (`checkValidOnly`):\n * - ***Return `true` if:***\n * - A phone number is \"valid\" when it has valid length, and the actual phone number digits match the\n * regular expressions for its country (parameter options `defaultCountry`).\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * ***Phone number to format, accepts:***\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberMain} [options]\n * ***Main options object controlling:***\n * - `separator` (**string**): Group separator, default `\" \"`.\n * - `plusNumberCountry` (**string**): Country code with optional leading `+`.\n * - `openingNumberCountry` (**string**): Characters before the country code, e.g. `\"(\"`.\n * - `closingNumberCountry` (**string**): Characters after the country code, e.g. `\")\"`.\n * - `checkValidOnly` (**boolean**): Return only validity.\n * - `takeNumberOnly` (**boolean**): Return digits only.\n * - `defaultCountry` (**string** - **`<ISO-3166-1 alpha-2>`**): Used to interpret numbers without an explicit `+<countryCode>`.\n * @returns {string|boolean} Formatted phone number string, digits-only string, or boolean.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberCheckValidOnly} [options] With `checkValidOnly: true`.\n * Return a **validity-check mode** when `checkValidOnly: true`.\n * @returns {boolean} A boolean indicating whether the input is a valid phone number.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberTransform} [options] With `takeNumberOnly: true`.\n * Return **digits-only mode** when `takeNumberOnly: true`.\n * @returns {string} A string of digits only.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * Return a **formatted phone number string** with custom formatting and (`checkValidOnly: false`, `takeNumberOnly: false`).\n * @returns {string} Formatting number. return a string of digits only with formatter.\n * @example\n * 1. ***Formatting Phone Number String:***\n * ```ts\n * formatPhoneNumber(\"081234567890\");\n * // ➔ \"0812 3456 7890\"\n * formatPhoneNumber(\"081234567890\", {\n * separator: \"-\",\n * plusNumberCountry: \"+44\",\n * openingNumberCountry: \"(\",\n * closingNumberCountry: \")\"\n * });\n * // ➔ \"(+44) 8123-4567-890\"\n * ```\n * 2. ***Digits-Only Mode:***\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * takeNumberOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * takeNumberOnly: true,\n * defaultCountry: \"DE\"\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", { takeNumberOnly: true });\n * // ➔ \"\"\n * ```\n * 3. ***Validity-Check Mode:***\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", { checkValidOnly: true});\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", { checkValidOnly: true });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberTransform\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Digits-only Mode`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros)\n * - `number` (leading zeros will be lost)\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {string} Digits-only mode, return string a digits-only.\n * @example\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * takeNumberOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * takeNumberOnly: true,\n * defaultCountry: \"DE\"\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", { takeNumberOnly: true });\n * // ➔ \"\"\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberTakeNumberOnly\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Validity-check Mode`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", { checkValidOnly: true});\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", { checkValidOnly: true });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberCheckValidOnly\n): boolean;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Validity-check Mode`***, because `checkValidOnly` has set to `true`.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassingValidOnly\n): boolean;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Digits-only Mode`***, because `takeNumberOnly` has set to `true`.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros)\n * - `number` (leading zeros will be lost)\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {string} Digits-only mode, return string a digits-only.\n * @example\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * defaultCountry: \"PH\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * defaultCountry: \"PH\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * defaultCountry: \"DE\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\"\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassingTakeOnly\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Validity-check Mode`***, because `checkValidOnly` and `takeNumberOnly` has set to `true`,\n * but `checkValidOnly` will prioritize one.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassing\n): boolean;\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options: FormatPhoneNumberMain = {}\n): string | boolean {\n if (isNil(value)) return \"\";\n\n if (!isString(value) && !isNumber(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\`, \\`number\\`, \\`null\\` or \\`undefined\\`, but received: \\`${getPreciseType(\n value\n )}\\`.`\n );\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 takeNumberOnly = hasOwnProp(options, \"takeNumberOnly\")\n ? options.takeNumberOnly\n : false;\n const checkValidOnly = hasOwnProp(options, \"checkValidOnly\")\n ? options.checkValidOnly\n : false;\n const defaultCountry: typeof options.defaultCountry = hasOwnProp(\n options,\n \"defaultCountry\"\n )\n ? options.defaultCountry\n : undefined;\n\n const separator = hasOwnProp(options, \"separator\") ? options.separator : \" \";\n const prependPlusCountryCode = hasOwnProp(options, \"prependPlusCountryCode\")\n ? options.prependPlusCountryCode\n : true;\n const outputFormat: OutputFormat = hasOwnProp(options, \"outputFormat\")\n ? options.outputFormat\n : \"INTERNATIONAL\";\n const openingNumberCountry = hasOwnProp(options, \"openingNumberCountry\")\n ? options.openingNumberCountry\n : \"\";\n const closingNumberCountry = hasOwnProp(options, \"closingNumberCountry\")\n ? options.closingNumberCountry\n : \"\";\n\n if (\n !isBoolean(takeNumberOnly) ||\n !isBoolean(checkValidOnly) ||\n !isBoolean(prependPlusCountryCode)\n ) {\n throw new TypeError(\n `Parameter \\`takeNumberOnly\\`, \\`checkValidOnly\\` and \\`prependPlusCountryCode\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\` or unset as \\`undefined\\` value, but received: ['takeNumberOnly': \\`${getPreciseType(\n takeNumberOnly\n )}\\`, 'checkValidOnly': \\`${getPreciseType(\n checkValidOnly\n )}\\`, 'prependPlusCountryCode': \\`${getPreciseType(prependPlusCountryCode)}\\`].`\n );\n }\n\n if (!isUndefined(defaultCountry) && !isSupportedCountry(defaultCountry)) {\n throw new TypeError(\n `Parameter \\`defaultCountry\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` as \\`CountryCode\\` (ISO-3166-1 alpha-2) or unset as \\`undefined\\` value, but received: \\`${getPreciseType(\n defaultCountry\n )}\\`, with value: \\`${safeStableStringify(defaultCountry, {\n keepUndefined: true\n })}\\`.\\n\\nSee: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements, for all ISO 3166-1 alpha-2 code.`\n );\n }\n\n if (\n ![\"INTERNATIONAL\", \"NATIONAL\", \"RFC3966\", \"E.164\"].includes(outputFormat)\n ) {\n throw new TypeError(\n `Parameter \\`outputFormat\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` as \\`OutputFormat\\` (\"NATIONAL\" | \"INTERNATIONAL\" | \"E.164\" | \"RFC3966\") or unset as \\`undefined\\` (default value to: \\`INTERNATIONAL\\`) value, but received: \\`${getPreciseType(\n outputFormat\n )}\\`, with value: ${safeStableStringify(outputFormat, { keepUndefined: true })}.`\n );\n }\n\n if (\n !isString(separator) ||\n !isString(openingNumberCountry) ||\n !isString(closingNumberCountry)\n ) {\n throw new TypeError(\n `Parameter \\`separator\\`, \\`plusNumberCountry\\`, \\`openingNumberCountry\\` and \\`closingNumberCountry\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` or unset as \\`undefined\\` value, but received: ['separator': \\`${getPreciseType(\n separator\n )}\\`,'openingNumberCountry': \\`${getPreciseType(\n openingNumberCountry\n )}\\`, 'closingNumberCountry': \\`${getPreciseType(closingNumberCountry)}\\`].`\n );\n }\n\n if (!isString(value)) value = String(value);\n\n const parsedPhoneNumber = parsingAsYouType(value, defaultCountry);\n const validPhoneNumber = isValidParseAsYouType(parsedPhoneNumber);\n\n if (checkValidOnly) return validPhoneNumber;\n\n // todo: return empty-string is invalid phone-number input.\n if (!validPhoneNumber) return \"\";\n\n if (takeNumberOnly) {\n return parsedPhoneNumber.getNumber().formatNational().replace(/\\D/g, \"\");\n }\n\n const num = parsedPhoneNumber.getNumber();\n // Result example: \"+49 1512 3456789\"\n const intlNumb = num.format(outputFormat);\n\n if (outputFormat === \"INTERNATIONAL\") {\n // Split to: [\"+49\", \"1512\", \"3456789\"]\n const [cc, ...rest] = intlNumb.split(\" \");\n const countryCode = prependPlusCountryCode ? cc : cc?.replace(/^\\++/, \"\");\n const restWithSeparator = rest.join(separator);\n\n if (!countryCode) return restWithSeparator;\n\n if (\n isNonEmptyString(openingNumberCountry) &&\n isNonEmptyString(closingNumberCountry)\n ) {\n return `${openingNumberCountry}${countryCode}${closingNumberCountry} ${restWithSeparator}`;\n }\n\n return `${countryCode} ${restWithSeparator}`;\n }\n\n if (outputFormat === \"NATIONAL\") {\n const restWithSeparator = intlNumb.split(\" \").join(separator);\n\n return `${restWithSeparator}`;\n }\n\n return intlNumb;\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { censorEmail } from \"../censorEmail\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\n\n/** ***Util helper for {@link censorEmail}.***\n *\n * @internal\n */\nexport const hashSeedGenerate = (mode: \"random\" | \"fixed\", email: string) => {\n const generateSeed = () => {\n let hash = 0;\n for (let i = 0; i < email.length; i++) {\n hash = (hash << 5) - hash + email.charCodeAt(i);\n hash |= 0; // Convert to 32bit int\n }\n return Math.abs(hash);\n };\n\n return mode === \"fixed\" ? generateSeed() : undefined;\n};\n\n/** ----------------------------------------------------------\n * * ***Internal Randomly replaces characters in a string with \"\\*\".***\n * ----------------------------------------------------------\n *\n * @param {string} str - The string to censor.\n * @param {number} minCensor - Minimum number of characters to censor.\n * @param {number} maxPercentage - Maximum percentage of characters to censor.\n * @returns {string} - Censored string.\n *\n * @internal ***Util helper for {@link censorEmail}.***\n */\nexport const _censor = (\n str: string,\n minCensor: number,\n maxPercentage: number,\n hashSeed: number | undefined\n): string => {\n if (str.length <= minCensor) return \"*\".repeat(str.length);\n\n const strArr = str.split(\"\");\n const totalCensor = Math.max(\n minCensor,\n Math.ceil(str.length * maxPercentage)\n );\n const indexes = new Set<number>();\n\n let i = 0;\n while (indexes.size < totalCensor) {\n const idx = !isUndefined(hashSeed)\n ? (hashSeed + str.length + i * 31) % str.length\n : Math.floor(Math.random() * str.length);\n indexes.add(idx);\n i++;\n }\n\n for (const index of indexes) {\n strArr[index] = \"*\";\n }\n\n return strArr.join(\"\");\n};\n","import { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\nimport { _censor, hashSeedGenerate } from \"./_private/censorEmail.utils\";\n\ntype CensorEmailOptions = {\n /** ----------------------------------------------------------\n * * ***Censorship Mode.***\n * ----------------------------------------------------------\n * - **Valid value:**\n * - `\"fixed\"` (default) – Deterministic censorship based on a hash of the email, same input always produces the same output.\n * - `\"random\"` – Each character is randomly replaced every time the function is called.\n */\n mode?: \"random\" | \"fixed\";\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `censorEmail`.***\n * ----------------------------------------------------------\n * **Censors an email by replacing characters with `\"*\"` while supporting random or fixed mode.**\n * - **This function replaces parts of an email with asterisks to protect privacy.**\n * - **Modes:**\n * - `\"fixed\"` (default) – Deterministic censorship based on a hash of the email, same input always produces the same output.\n * - `\"random\"` – Each character is randomly replaced every time the function is called.\n * - **ℹ️ Note:**\n * - Invalid emails or non-string input will return an empty-string (`\"\"`).\n * @param {string | null | undefined} email - The email address to censor.\n * @param {CensorEmailOptions} [options={}] - Options object for mode.\n * @returns {string} The censored email, or an empty string if input is invalid.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not a plain object or `mode` is invalid.\n * @example\n * // Fixed mode (default, deterministic)\n * censorEmail(\"john.doe@gmail.com\");\n * // ➔ \"j**n.**e@g***l.com\"\n *\n * // Fixed mode explicitly\n * censorEmail(\"john.doe@gmail.com\", { mode: \"fixed\" });\n * // ➔ \"j**n.**e@g***l.com\"\n *\n * // Random mode (output may vary each time)\n * censorEmail(\"john.doe@gmail.com\", { mode: \"random\" });\n * // ➔ \"j*hn.***e@g***l.com\" (random)\n *\n * // Invalid email returns empty string\n * censorEmail(\"invalid-email\");\n * // ➔ \"\"\n */\nexport const censorEmail = (\n email: string | null | undefined,\n options: CensorEmailOptions = {}\n): string => {\n if (!isNonEmptyString(email)) return \"\";\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const mode = hasOwnProp(options, \"mode\") ? options.mode : \"fixed\";\n\n // Ensure mode is either \"random\" or \"fixed\"\n if (mode !== \"random\" && mode !== \"fixed\") {\n throw new TypeError(\n `Parameter \\`mode\\` property of the \\`options\\` (second parameter) must be one of \"fixed\" or \"random\", but received: \\`${getPreciseType(\n mode\n )}\\`, with value: \\`${safeStableStringify(mode, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // Strict email validation regex\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n if (!emailRegex.test(email)) return \"\";\n\n const [local, domain] = email.split(\"@\");\n const domainParts = domain?.split(\".\"); // Handle multi-level domain (e.g., example.co.uk)\n if (!local || !domainParts || domainParts.length < 2) return \"\"; // Invalid domain structure\n\n const [domainName, ...tldParts] = domainParts;\n\n if (!domainName) return \"\";\n\n const tld = tldParts.join(\".\");\n\n const hashSeed = hashSeedGenerate(mode, email);\n\n const localMinCensor = local.length < 4 ? 1 : 2;\n const domainMinCensor = domainName.length < 4 ? 1 : 2;\n\n const censoredLocal = _censor(local, localMinCensor, 0.6, hashSeed);\n const censoredDomain = _censor(domainName, domainMinCensor, 0.5, hashSeed);\n const censoredTLD = tld.length <= 2 ? tld : _censor(tld, 1, 0.4, hashSeed);\n\n return `${censoredLocal}@${censoredDomain}.${censoredTLD}`;\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isInteger } from \"@/predicates/is/isInteger\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { normalizeSpaces } from \"@/strings/sanitizations/normalizeSpaces\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\ntype ChunkStringOptions = {\n /** ***The separator string to insert between characters or words.***\n *\n * - Used when inserting separators every `limiter` characters.\n * - Default is a single space `\" \"`.\n *\n * @default \" \"\n */\n separator?: string;\n\n /** ***Determines whether counting for `limiter` resets after each space.***\n *\n * - If `true`, the string is treated as words separated by spaces,\n * and separators are applied within words, then words are grouped.\n * - If `false` ***(default)***, counting is continuous across the whole string,\n * treating spaces as normal characters.\n *\n * @default false\n */\n reCountAfterSpace?: boolean;\n};\n\n/** ----------------------------------------------\n * * ***Utility: `chunkString`.***\n * ----------------------------------------------\n * **Chunks a string by inserting a separator every `limiter` characters.**\n * - **This function handles two main behaviors based on `reCountAfterSpace`:**\n * 1. ***If `reCountAfterSpace` is `false` (default):***\n * - The separator is inserted strictly every `limiter` characters throughout the entire string, regardless of spaces, spaces are treated as regular characters in the count.\n * - Example: `chunkString(\"1234567890\", 3, \"-\")` ➔ `\"123-456-789-0\"`.\n * - Example: `chunkString(\"Hello World\", 3, \"-\")` ➔ `\"Hel-lo -Wor-ld\"`.\n * 2. ***If `reCountAfterSpace` is `true`:***\n * - The function first processes the input string to replace any multiple consecutive spaces with a\n * single space (e.g., \"A B\" becomes \"A B\").\n * Then, it treats the string as a sequence of \"words\" (segments separated by single spaces).\n * - Each word is processed independently:\n * - if a word's length exceeds the `limiter`, separators are inserted internally within that word.\n * - Words are then grouped. Each group will contain `limiter` number of words.\n * - Words within the same group are joined by the specified `separator`.\n * - Finally, these groups are joined by a single space, preserving the original word separation\n * structure between groups.\n * @param {string} subject - ***The target string to chunk.****\n * @param {number} limiter\n * ***The interval (number of characters) for inserting separators, behavior:***\n * - If `reCountAfterSpace = false`, it counts characters.\n * - If `reCountAfterSpace = true`, it counts both characters within words and words per group.\n * @param {ChunkStringOptions} [options={}] - ***Optional settings for separator and counting behavior.***\n * @returns {string} Return the formatted string with separators.\n * @example\n * // Basic usage\n * chunkString(\"1234567890\", 3);\n * // ➔ \"123 456 789 0\"\n *\n * // Basic usage `reCountAfterSpace = false` (default)\n * chunkString(\"1234567890\", 3, { separator: \"-\");\n * // ➔ \"123-456-789-0\"\n * chunkString(\"HelloWorld\", 2, { separator: \"_\", reCountAfterSpace: false });\n * // ➔ \"He_ll_oW_or_ld\"\n *\n * // Usage with reCountAfterSpace = true:\n * // Multiple spaces are normalized to single spaces before processing.\n * chunkString(\"AB CD EF GH\", 2, { separator: \"-\", reCountAfterSpace: true });\n * // ➔ \"AB-CD EF-GH\" (after normalization to \"AB CD EF GH\")\n * // Words \"AB\" and \"CD\" form a group and are joined by \"-\", \"EF\" and \"GH\" form another group.\n * // The groups \"AB-CD\" and \"EF-GH\" are then joined by a space.\n *\n * // Another usage with reCountAfterSpace = true:\n * chunkString(\"ABC DEF GHI JKL\", 3, { separator: \"-\", reCountAfterSpace: true });\n * // ➔ \"ABC-DEF-GHI JKL\"\n * // Words \"ABC\", \"DEF\", \"GHI\" form a group and are joined by \"-\".\n * // The word \"JKL\" forms its own group (as it's the last word and completes no other group).\n * // The groups \"ABC-DEF-GHI\" and \"JKL\" are then joined by a space.\n */\nexport function chunkString(\n subject: string,\n limiter: number,\n options: ChunkStringOptions = {}\n): string {\n if (isNil(subject) || limiter <= 0) return subject;\n\n assertIsString(subject, {\n message: ({ currentType, validType }) =>\n `First parameter (\\`subject\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (!isInteger(limiter)) {\n throw new TypeError(\n `Second parameter (\\`limiter\\`) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n limiter\n )}\\`, with value: \\`${safeStableStringify(limiter, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Third parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const separator = hasOwnProp(options, \"separator\") ? options.separator : \" \";\n const reCountAfterSpace = hasOwnProp(options, \"reCountAfterSpace\")\n ? options.reCountAfterSpace\n : false;\n\n assertIsString(separator, {\n message: ({ currentType, validType }) =>\n `Parameter \\`separator\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsBoolean(reCountAfterSpace, {\n message: ({ currentType, validType }) =>\n `Parameter \\`reCountAfterSpace\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n subject = normalizeSpaces(subject);\n\n // Handle reCountAfterSpace = false (assumed correct from previous iterations)\n if (!reCountAfterSpace) {\n let result = \"\";\n let currentCount = 0;\n\n for (let i = 0; i < subject.length; i++) {\n const char = subject[i];\n if (currentCount === limiter) {\n result += separator;\n currentCount = 0;\n }\n result += char;\n currentCount++;\n }\n return result;\n }\n\n // --- Dynamic Logic for reCountAfterSpace = true ---\n const words = subject.split(\" \"); // Split the string into individual words by spaces\n const finalSegments: string[] = [];\n\n let currentGroup: string[] = [];\n let wordsInCurrentGroupCount = 0; // This counts how many words are in the current group\n\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n\n // Check if the current word itself needs internal separators (e.g., \"HelloWorld\" with limiter 2)\n // For the given test cases (\"AB\", \"CD\", \"ABC\"), this inner loop doesn't add separators,\n // as the words themselves are shorter than or equal to the limiter.\n let processedWord = \"\";\n let charCountInWord = 0;\n\n if (word) {\n for (let j = 0; j < word.length; j++) {\n processedWord += word[j];\n charCountInWord++;\n if (charCountInWord === limiter && j < word.length - 1) {\n processedWord += separator;\n charCountInWord = 0;\n }\n }\n }\n\n currentGroup.push(processedWord);\n wordsInCurrentGroupCount++;\n\n // If the current group has reached the limiter (e.g., 2 words for limiter=2, or 3 words for limiter=3)\n // OR if it's the last word in the entire subject, finalize the group.\n if (wordsInCurrentGroupCount === limiter || i === words.length - 1) {\n finalSegments.push(currentGroup.join(separator)); // Join words within the group by separator\n currentGroup = []; // Reset group for the next set of words\n wordsInCurrentGroupCount = 0; // Reset group word count\n }\n }\n\n // Finally, join the main segments (groups) with spaces\n return finalSegments.join(\" \");\n}\n","import { isInteger } from \"@/predicates/is/isInteger\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\ntype TruncateStringOptions = {\n /** ***Maximum length of the truncated string **(default: `10`)**.***\n *\n * @default 10\n */\n length?: number;\n\n /** ***String to append if truncation occurs.***\n *\n * - Will be trimmed first; defaults to `\"...\"` if empty.\n *\n * @default \"...\"\n */\n ending?: string;\n\n /** ***Whether to trim the input string before truncation ***(default: `true`)***.***\n *\n * @default true\n */\n trim?: boolean;\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `truncateString`.***\n * ----------------------------------------------------------\n * **Features:**\n * - Truncates a string to a specified length and optionally appends an ending.\n * - Supports trimming the input before truncation.\n * - If truncation occurs, trailing spaces before the ending are removed.\n * - The `ending` parameter is always trimmed first; if empty, it defaults to `\"...\"`.\n * @param {string|null|undefined} text\n * ***The input string to truncate, behavior:***\n * - If `null`, `undefined`, or empty after trim, returns `\"\"`.\n * @param {TruncateStringOptions} [options]\n * ***Optional settings:***\n * - `length` (number, default 10): Maximum length of the truncated string.\n * - `ending` (string, default `\"...\"`): String to append if truncation occurs.\n * - `trim` (boolean, default `true`): Whether to trim the input before truncation.\n * @returns {string} The truncated string with optional trimming and ending, returns `\"\"` if input is empty or length < 1.\n * @throws **{@link TypeError | `TypeError`}** if `options.length` is not a finite number, or if `options.ending` is not a string, or if `options.trim` is not a boolean.\n * @example\n * truncateString(\"hello world\", { length: 5 });\n * // ➔ \"hello...\"\n * truncateString(\"hello world\", { length: 5, ending: \"---\" });\n * // ➔ \"hello---\"\n * truncateString(\"hello world\", { length: 5, ending: \" \" });\n * // ➔ \"hello...\" (ending trimmed to default)\n * truncateString(\"hello world\", { length: 5, ending: \" !!! \" });\n * // ➔ \"hello!!!\" (ending trimmed)\n * truncateString(\" long data string \", { length: 8, ending: \"...\", trim: true });\n * // ➔ \"long dat...\"\n * truncateString(\" long data string \", { length: 8, ending: \"...\", trim: false });\n * // ➔ \" long ...\"\n * truncateString(null, { length: 5 });\n * // ➔ \"\"\n */\nexport const truncateString = (\n text: string | null | undefined,\n options: TruncateStringOptions = {}\n): string => {\n if (!isNonEmptyString(text)) return \"\";\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Seconds parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const trim = hasOwnProp(options, \"trim\") ? options.trim : true;\n const length = hasOwnProp(options, \"length\") ? options.length : 10;\n let ending = hasOwnProp(options, \"ending\") ? options.ending : \"...\";\n\n if (!isInteger(length)) {\n throw new TypeError(\n `Parameter \\`length\\` property of the \\`options\\` (second parameter) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n length\n )}\\`, with value: \\`${safeStableStringify(length, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (length < 1) return \"\";\n\n assertIsString(ending, {\n message: ({ currentType, validType }) =>\n `Parameter \\`ending\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsBoolean(trim, {\n message: ({ currentType, validType }) =>\n `Parameter \\`trim\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (isEmptyString(ending)) {\n ending = \"...\";\n } else {\n ending = ending.trim();\n }\n\n const original = trim ? text.trim() : text;\n const originalTrimmedLength = original.length;\n\n if (originalTrimmedLength <= length) return original;\n\n const sliced = original.slice(0, length);\n const cleanSliced = trim ? sliced : sliced.trimEnd();\n\n return cleanSliced + ending;\n};\n","import type { FormatDateFnsOptions } from \"./_private/formatDateFns.types\";\n\nimport { id, enUS } from \"date-fns/locale\";\nimport { format as formatDns, parse } from \"date-fns\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateFns`.***\n * ----------------------------------------------------------\n * **Formats a date into a human-readable string using `date-fns`.**\n * - **Features:**\n * - Supports custom output formats using `date-fns/format`.\n * - Can parse localized non-ISO strings via `inputFormat` & `inputLocale`.\n * - Supports `locale` as `\"id\"`, `\"en\"` or `date-fns` `Locale` objects (like `id` or `enUS`).\n * - Returns `null` if the date is invalid, not provided, or parsing fails.\n * @param {string | Date | null | undefined} date\n * ***The date input to format, can be:***\n * - A `Date` object.\n * - An ISO string (e.g. `\"2024-01-01T12:00:00Z\"`).\n * - A localized string (requires `inputFormat` + `inputLocale`).\n * @param {FormatDateFnsOptions} [options] ***Options for formatting and parsing.***\n * @param {FormatDateFnsOptions[\"format\"]} [options.format=\"dd MMM yyyy - HH:mm:ss\"]\n * ***The output format string (passed to `date-fns/format`), e.g:***\n * - `\"dd MMMM yyyy, HH:mm:ss\" ➔ \"14 Juli 2025, 17:25:42\"`.\n * @param {FormatDateFnsOptions[\"locale\"]} [options.locale=\"id\"]\n * The output locale. If string, only `\"id\"` (Indonesian) or `\"en\"` (English)\n * is recognized. Or you can pass a `date-fns` `Locale` object.\n * - Example:\n * ```ts\n * import { ar } from \"date-fns/locale\";\n * formatDateFns(new Date(), { locale: ar, format: \"PPPppp\" });\n * ```\n * @param {FormatDateFnsOptions[\"inputLocale\"]} [options.inputLocale]\n * Required if `date` is a localized non-ISO string. Used with `inputFormat`.\n * - Example for Indonesian string:\n * ```ts\n * formatDateFns(\"14 Juli 2025 10:25:42\", { inputFormat: \"dd MMMM yyyy HH:mm:ss\", inputLocale: \"id\" });\n * ```\n * @param {FormatDateFnsOptions[\"inputFormat\"]} [options.inputFormat]\n * The format string to parse `date` if it is a non-ISO string.\n * Required together with `inputLocale`.\n * @returns {string | null} A formatted date string or `null` if input is invalid.\n * @example\n * formatDateFns(new Date());\n * // ➔ \"14 Jul 2025 - 17:25:42\"\n * formatDateFns(\"2025-07-14T10:25:42Z\", { format: \"dd/MM/yyyy\", locale: \"en\" });\n * // ➔ \"14/07/2025\"\n * formatDateFns(\"14 Juli 2025 10:25:42\", {\n * inputFormat: \"dd MMMM yyyy HH:mm:ss\",\n * inputLocale: \"id\",\n * format: \"yyyy-MM-dd\"\n * });\n * // ➔ \"2025-07-14\"\n * formatDateFns(null);\n * // ➔ null\n */\nexport const formatDateFns = (\n date: string | Date | null | undefined,\n options: FormatDateFnsOptions = {}\n): string | null => {\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;\n\n // Ensure options is an object and Defensive options check\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const {\n inputFormat,\n locale = \"en\",\n inputLocale = \"en\",\n ...restOptions\n } = options;\n\n const format =\n hasOwnProp(options, \"format\") && isNonEmptyString(options.format)\n ? options.format\n : \"dd MMM yyyy - HH:mm:ss\";\n\n let parsedDate: Date;\n\n try {\n if (isNonEmptyString(date) && inputFormat && inputLocale) {\n const valueOfInputLocale = isNonEmptyString(inputLocale)\n ? inputLocale === \"id\"\n ? id\n : enUS\n : inputLocale;\n\n parsedDate = parse(date, inputFormat, new Date(), {\n locale: valueOfInputLocale\n });\n } else {\n parsedDate = new Date(date);\n }\n\n if (isNaN(parsedDate.getTime())) return null;\n\n const valueOfLocale = isNonEmptyString(locale)\n ? locale === \"id\"\n ? id\n : enUS\n : locale;\n\n return formatDns(parsedDate, format, {\n ...restOptions,\n locale: valueOfLocale\n });\n } catch {\n return null;\n }\n};\n","import type { FormatDateIntlOptions } from \"./_private/formatDateIntl.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateIntl`.***\n * ----------------------------------------------------------\n * **Formats a date using the `Intl.DateTimeFormat` API.**\n * - **Features:**\n * - Supports custom locales (type-safe `SupportedLocales`).\n * - Accepts additional `Intl.DateTimeFormatOptions` like `timeZone`, `hour12`, etc.\n * - Defaults to `\"en-US\"` if `locale` is not provided or is an empty string.\n * - Returns `null` if the date is invalid, not provided, or options are invalid.\n * @param {string | Date | null | undefined} date\n * ***The date to format.***\n * - Can be a `Date` object or an ISO string.\n * - If invalid or not provided, returns `null`.\n * @param {FormatDateIntlOptions} [options] ***Optional formatting options for `Intl.DateTimeFormat`, use `locale` to specify the language & region format.***\n * @returns {string | null}\n * - Formatted date string.\n * - Returns `null` if date is invalid or options are of wrong type.\n * @example\n * formatDateIntl(new Date());\n * // ➔ \"7/14/2025\"\n * formatDateIntl(\"2025-07-14T00:00:00Z\", { locale: \"fr-FR\", dateStyle: \"long\" });\n * // ➔ \"14 juillet 2025\"\n * formatDateIntl(null);\n * // ➔ null\n * formatDateIntl(new Date(), { timeZone: \"UTC\", hour: \"2-digit\", minute: \"2-digit\" });\n * // ➔ \"01:30 AM\"\n */\nexport const formatDateIntl = (\n date: string | Date | null | undefined,\n options?: FormatDateIntlOptions\n): string | null => {\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;\n\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return null; // Handle invalid dates\n\n // Ensure options is an object and Defensive options check\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const { locale = \"en-US\", ...restProps } = options;\n\n try {\n return new Intl.DateTimeFormat(\n isNonEmptyString(locale) ? locale.trim() : \"en-US\",\n restProps\n ).format(parsedDate);\n } catch {\n return null;\n }\n};\n","import { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateTime`.***\n * ----------------------------------------------------------\n * **Formats a date and time into a custom string format.**\n * - **Features:**\n * - Supports only `YYYY`, `MM`, `DD`, `hh`, `mm`, and `ss` as placeholders.\n * - Uses a simple string replace (no locale).\n * - Returns `null` if the date is invalid or not provided.\n * - Defaults to `\"YYYY-MM-DD hh:mm:ss\"` format if none is specified.\n * @param {string | Date | null| undefined} date - The date to format.\n * @param {string} [format=\"YYYY-MM-DD hh:mm:ss\"] - The desired date format, if format is `null` or `undefined` will force to defaultValue, defaultValue is: `\"YYYY-MM-DD hh:mm:ss\"`.\n * @returns {string | null} The formatted date string or `null` if invalid.\n * @example\n * formatDateTime(new Date());\n * // ➔ \"2024-02-09 14:30:45\" (example output with current time)\n * formatDateTime(\"2023-07-01T14:30:45\");\n * // ➔ \"2023-07-01 14:30:45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"DD/MM/YYYY\");\n * // ➔ \"01/07/2023\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYY/MM/DD hh-mm-ss\");\n * // ➔ \"2023/07/01 14-30-45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"hh:mm\");\n * // ➔ \"14:30\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"DATE: YYYY.MM.DD\");\n * // ➔ \"DATE: 2023.07.01\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"Year: YYYY, Time: hh:mm:ss\");\n * // ➔ \"Year: 2023, Time: 14:30:45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYY-MM\");\n * // ➔ \"2023-07\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYYYYYY\");\n * // ➔ \"20232023\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"hh:mm:ss:ss\");\n * // ➔ \"14:30:45:45\"\n * formatDateTime(\"invalid-date\");\n * // ➔ null\n * formatDateTime(null);\n * // ➔ null\n * formatDateTime(undefined);\n * // ➔ null\n */\nexport const formatDateTime = (\n date: string | Date | null | undefined,\n format?: string\n): string | null => {\n if (isNil(format)) {\n format = \"YYYY-MM-DD hh:mm:ss\";\n }\n\n if (!isString(format)) return null;\n\n // Handle missing or invalid date input type\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) {\n return null;\n }\n\n try {\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return null; // Handle invalid dates\n\n const pad2 = (n: number) => n.toString().padStart(2, \"0\");\n\n const map: Record<string, string> = {\n YYYY: parsedDate.getFullYear().toString(),\n MM: pad2(parsedDate.getMonth() + 1),\n DD: pad2(parsedDate.getDate()),\n hh: pad2(parsedDate.getHours()),\n mm: pad2(parsedDate.getMinutes()),\n ss: pad2(parsedDate.getSeconds())\n };\n\n const result = Object.entries(map).reduce(\n (prev, [key, value]) => prev.split(key).join(value),\n format\n );\n\n return !result.includes(\"NaN\") ? result : null;\n } catch {\n return null;\n }\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `getGMTOffset`.***\n * ----------------------------------------------------------\n * **Returns the formatted GMT offset (e.g., `+0700`, `-0500`) for a given date.**\n * - **Features:**\n * - If `date` is **not provided** or empty string, it defaults to the current date/time.\n * - If `date` is **invalid** or of wrong type (like object or number), it returns `\"0\"`.\n * - The returned string follows the **GMT offset format** (`±HHMM`), where:\n * - `±` is `+` if ahead of UTC, `-` if behind.\n * - `HH` is two-digit hours.\n * - `MM` is two-digit minutes.\n * @param {string | Date | null} [date]\n * ***The date to get the GMT offset from.***\n * - Accepts `Date` object or ISO date string (e.g., `\"2024-01-01T12:00:00Z\"`).\n * - If `null`, `undefined`, or empty string, uses current system date.\n * - If invalid date or wrong type (like `123` or `{}`), returns `\"0\"`.\n * @returns {string} The GMT offset string in format `±HHMM`,\n * e.g. `\"+0700\"`, `\"-0530\"`, or `\"0\"` if invalid.\n * @example\n * getGMTOffset();\n * // ➔ \"+0700\" (depends on your system timezone)\n * getGMTOffset(new Date(\"2024-02-09T12:00:00Z\"));\n * // ➔ \"+0000\"\n * getGMTOffset(\"2024-02-09\");\n * // ➔ \"+0700\" (depends on your system timezone)\n * getGMTOffset(\"invalid-date\");\n * // ➔ \"0\"\n * getGMTOffset(123);\n * // ➔ \"0\"\n */\nexport const getGMTOffset = (date?: string | Date | null): string => {\n try {\n if (isNil(date) || (isString(date) && isEmptyString(date))) {\n date = new Date(); // Default to current date\n } else if (!(isDate(date) || isNonEmptyString(date))) {\n return \"0\"; // Invalid type\n }\n\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return \"0\"; // Handle invalid dates\n\n const padZero = (num: number) => num.toString().padStart(2, \"0\");\n\n let offset = parsedDate.getTimezoneOffset();\n const sign = offset < 0 ? \"+\" : \"-\";\n offset = Math.abs(offset);\n\n return `${sign}${padZero(Math.floor(offset / 60))}${padZero(offset % 60)}`;\n } catch {\n return \"0\";\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,sBAAsB,EAC1B,QACA,gBAII;CACJ,MAAM,YAAY,QAAQ,MAAM,EAAE;CAClC,MAAM,OAAO,QAAQ,MAAM,GAAG,EAAE;CAChC,IAAI,CAAC,MAAM,OAAO;CAClB,OACE,KAAK,QAAQ,yBAAyB,SAAS,IAAI,YAAY;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqOA,MAAa,kBACX,OACA,UAAiC,CAAC,MACvB;CACX,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,KAAK,GACrC,MAAM,IAAI,UACR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