@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":"normalizeSpaces-BoUDtq5P.js","names":[],"sources":["../src/strings/sanitizations/normalizeSpaces.ts"],"sourcesContent":["import { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\ntype NormalizeSpacesOptions = {\n /** If `true`, skips normalization and only trims whitespace from start & end, defaultValue: `false`.\n *\n * @default false\n */\n trimOnly?: boolean;\n /** If `false`, skips trimming value, defaultValue: `true`.\n *\n * @default true\n */\n withTrim?: boolean;\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `normalizeSpaces`.***\n * ----------------------------------------------------------\n * **Normalizes whitespace in a string by reducing multiple spaces\n * to a single space, optionally trims, or only trims based on options.**\n * - **Behavior:**\n * - Collapses all consecutive whitespace (spaces, tabs, newlines) into a single space.\n * - Can trim leading/trailing spaces (default behavior), or preserve them with `withTrim: false`.\n * - Can skip normalization entirely and only trim using `trimOnly: true`.\n * - Returns an empty string if input is `null` or `undefined`.\n * @param {string | null | undefined} value - The input string to be processed. If `null` or `undefined`, returns an empty string.\n * @param {NormalizeSpacesOptions} [options] - Configuration options.\n * @param {NormalizeSpacesOptions[\"trimOnly\"]} [options.trimOnly=false] - If `true`, skips normalization and only trims the string.\n * @param {NormalizeSpacesOptions[\"withTrim\"]} [options.withTrim=true] - If `false`, preserves leading/trailing whitespace.\n * @returns {string} The processed string.\n * @example\n * normalizeSpaces(\" Hello World\\tthis is\\n\\nok \");\n * // ➔ \"Hello World this is ok\"\n * normalizeSpaces(\" Hello World\\tthis is\\n\\nok \", { trimOnly: true });\n * // ➔ \"Hello World\tthis is\\n\\nok\"\n * normalizeSpaces(\" Hello World \", { withTrim: false });\n * // ➔ \" Hello World \"\n * normalizeSpaces(null);\n * // ➔ \"\"\n */\nexport const normalizeSpaces = (\n value: string | null | undefined,\n options: NormalizeSpacesOptions = {\n withTrim: true,\n trimOnly: false\n }\n): string => {\n if (!isNonEmptyString(value)) return \"\";\n\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const { trimOnly = false, withTrim = true } = options;\n\n if (trimOnly) return value.trim();\n\n if (withTrim) {\n value = value.trim();\n }\n\n // Remove all duplicate spaces (including tabs, newlines, etc.)\n return value.replace(/\\s+/g, \" \");\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,mBACX,OACA,UAAkC;CAChC,UAAU;CACV,UAAU;AACZ,MACW;CACX,IAAI,CAAC,iBAAiB,KAAK,GAAG,OAAO;CAErC,IAAI,CAAC,cAAc,OAAO,GACxB,UAAU,CAAC;CAGb,MAAM,EAAE,WAAW,OAAO,WAAW,SAAS;CAE9C,IAAI,UAAU,OAAO,MAAM,KAAK;CAEhC,IAAI,UACF,QAAQ,MAAM,KAAK;CAIrB,OAAO,MAAM,QAAQ,QAAQ,GAAG;AAClC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parsers-B8KYXIjE.js","names":[],"sources":["../src/parsers/_private/extensions.ts","../src/parsers/extractFileName.ts"],"sourcesContent":["// ==========================\n// Single extensions\n// ==========================\nexport const EXTENSIONS_FILE = new Set([\n // 📄 Text & Document\n \"txt\",\n \"md\",\n \"rtf\",\n \"tex\",\n \"doc\",\n \"docx\",\n \"odt\",\n \"ott\",\n \"pdf\",\n \"djvu\",\n \"epub\",\n \"fb2\",\n \"lit\",\n \"lrf\",\n \"xls\",\n \"xlsx\",\n \"ods\",\n \"csv\",\n \"tsv\",\n \"ppt\",\n \"pptx\",\n \"pps\",\n \"bib\",\n \"cba\",\n \"cbt\",\n \"cbz\",\n \"cbr\",\n \"opds\",\n \"fodt\",\n \"pages\",\n \"rtfd\",\n \"sxc\",\n \"sxw\",\n \"wpd\",\n \"xps\",\n \"dotx\",\n \"dotm\",\n \"xltx\",\n \"xltm\",\n \"sldx\",\n \"sldm\",\n \"fods\",\n \"mdx\",\n \"markdown\",\n \"texi\",\n \"textile\",\n\n // 🖼️ Image\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"gif\",\n \"bmp\",\n \"tif\",\n \"tiff\",\n \"webp\",\n \"svg\",\n \"ico\",\n \"heif\",\n \"heic\",\n \"raw\",\n \"cr2\",\n \"nef\",\n \"orf\",\n \"sr2\",\n \"dng\",\n \"dds\",\n \"psd\",\n \"exr\",\n \"xcf\",\n \"ai\",\n \"eps\",\n \"cdr\",\n \"indd\",\n \"pcx\",\n \"pgm\",\n \"ppm\",\n \"pbm\",\n \"pnm\",\n \"jfif\",\n \"ras\",\n \"tga\",\n \"j2k\",\n \"jp2\",\n \"emf\",\n \"wmf\",\n \"hdp\",\n \"mdi\",\n \"hevc\",\n\n // 🎵 Audio\n \"mp3\",\n \"wav\",\n \"ogg\",\n \"flac\",\n \"aac\",\n \"m4a\",\n \"wma\",\n \"alac\",\n \"aiff\",\n \"aif\",\n \"amr\",\n \"mid\",\n \"midi\",\n \"opus\",\n \"au\",\n \"caf\",\n \"ape\",\n \"mka\",\n \"spx\",\n \"ra\",\n \"ram\",\n \"mpc\",\n \"wv\",\n \"aifc\",\n \"mod\",\n \"it\",\n \"s3m\",\n \"xm\",\n \"kar\",\n \"m4b\",\n \"voc\",\n \"snd\",\n \"a52\",\n \"ac3\",\n \"dts\",\n\n // 🎥 Video\n \"mp4\",\n \"mkv\",\n \"avi\",\n \"mov\",\n \"wmv\",\n \"webm\",\n \"mpeg\",\n \"mpg\",\n \"3gp\",\n \"3g2\",\n \"m4v\",\n \"ts\",\n \"mts\",\n \"asf\",\n \"rm\",\n \"rmvb\",\n \"vob\",\n \"f4v\",\n \"ogv\",\n \"m2ts\",\n \"dav\",\n \"mxf\",\n \"mjpeg\",\n \"flv\",\n \"divx\",\n \"f4a\",\n \"f4p\",\n \"m2v\",\n \"ogm\",\n \"vp8\",\n \"vp9\",\n \"xvid\",\n \"yuv\",\n \"mng\",\n \"dv\",\n \"m1v\",\n \"roq\",\n \"m2t\",\n \"av1\",\n \"hevc\",\n \"m3u\",\n \"m3u8\",\n\n // 🗃️ Archive & Compression\n \"zip\",\n \"rar\",\n \"7z\",\n \"tar\",\n \"gz\",\n \"bz\",\n \"bz2\",\n \"xz\",\n \"tgz\",\n \"tbz2\",\n \"txz\",\n \"lz\",\n \"lzma\",\n \"z\",\n \"cab\",\n \"arj\",\n \"ace\",\n \"rpm\",\n \"deb\",\n \"pkg\",\n \"apk\",\n \"jar\",\n \"war\",\n \"ear\",\n \"sit\",\n \"sitx\",\n \"cpgz\",\n \"tlz\",\n \"tlzma\",\n \"tzo\",\n \"cpio\",\n \"shar\",\n \"bzip\",\n \"gzip\",\n \"7zip\",\n \"rar5\",\n \"tbz\",\n \"txz\",\n\n // 💾 Disk Image\n \"iso\",\n \"img\",\n \"vhd\",\n \"vmdk\",\n \"qcow2\",\n \"vhdx\",\n \"bin\",\n \"cue\",\n \"nrg\",\n \"daa\",\n \"sdi\",\n \"vfd\",\n \"ima\",\n \"dmg\",\n \"vdi\",\n \"toast\",\n \"ccd\",\n \"mdf\",\n \"cdi\",\n \"bif\",\n \"bifc\",\n \"bifd\",\n\n // 🗃️ Database & Data\n \"sql\",\n \"db\",\n \"dbf\",\n \"mdb\",\n \"accdb\",\n \"json\",\n \"toml\",\n \"ini\",\n \"log\",\n \"plist\",\n \"pkl\",\n \"msgpack\",\n \"h5\",\n \"hdf5\",\n \"parquet\",\n \"avro\",\n \"orc\",\n \"ndjson\",\n \"pdb\",\n \"sqlite\",\n \"sqlite3\",\n \"dbx\",\n \"sdf\",\n \"nc\",\n \"netcdf\",\n \"grib\",\n \"geojson\",\n \"gml\",\n \"hjson\",\n \"cdb\",\n \"db3\",\n \"dta\",\n \"sav\",\n \"sas7bdat\",\n \"ldif\",\n \"fdb\",\n \"gdb\",\n \"sqlite2\",\n \"h5ad\",\n \"nc4\",\n \"xmind\",\n \"drawio\",\n \"sdc\",\n \"jsonl\",\n \"yaml\",\n \"yml\",\n \"toml\",\n\n // 💻 Code & Script\n \"js\",\n \"jsx\",\n \"ts\",\n \"tsx\",\n \"c\",\n \"cpp\",\n \"net\",\n \"h\",\n \"hpp\",\n \"java\",\n \"py\",\n \"rb\",\n \"go\",\n \"rs\",\n \"php\",\n \"pl\",\n \"sh\",\n \"bat\",\n \"cmd\",\n \"ps1\",\n \"lua\",\n \"swift\",\n \"kt\",\n \"scala\",\n \"cs\",\n \"vb\",\n \"dart\",\n \"m\",\n \"r\",\n \"jl\",\n \"fs\",\n \"vbproj\",\n \"sln\",\n \"pri\",\n \"gemspec\",\n \"gradle\",\n \"coffee\",\n \"erl\",\n \"ex\",\n \"exs\",\n \"hs\",\n \"lisp\",\n \"clj\",\n \"groovy\",\n \"scm\",\n \"vbs\",\n \"nim\",\n \"rkt\",\n \"ml\",\n \"mli\",\n \"fsx\",\n \"psm1\",\n \"cbl\",\n \"for\",\n \"f90\",\n \"lock\",\n \"tsconfig\",\n \"vue\",\n \"svelte\",\n \"cjs\",\n \"mjs\",\n \"mts\",\n \"cts\",\n \"json5\",\n \"es6\",\n \"module\",\n \"systemjs\",\n\n // 🌐 Web & Config\n \"html\",\n \"htm\",\n \"xhtml\",\n \"css\",\n \"scss\",\n \"sass\",\n \"less\",\n \"xml\",\n \"xlf\",\n \"po\",\n \"pot\",\n \"jsp\",\n \"asp\",\n \"aspx\",\n \"jspf\",\n \"cgi\",\n \"cfm\",\n \"env\",\n \"babelrc\",\n \"cfg\",\n \"config\",\n \"conf\",\n \"editorconfig\",\n \"eslintrc\",\n \"gitconfig\",\n \"gitattributes\",\n \"gitignore\",\n \"prettierrc\",\n \"webmanifest\",\n \"dockerfile\",\n // \".dockerfile\",\n\n // 🔠 Font\n \"ttf\",\n \"otf\",\n \"woff\",\n \"woff2\",\n \"eot\",\n \"dfont\",\n \"pfa\",\n \"pfb\",\n \"fon\",\n \"fnt\",\n \"bdf\",\n \"ps\",\n\n // 🗺️ CAD & GIS\n \"dwg\",\n \"dxf\",\n \"shp\",\n \"kml\",\n \"kmz\",\n \"gpx\",\n \"stl\",\n \"step\",\n \"iges\",\n \"igs\",\n \"3ds\",\n \"3dm\",\n \"fbx\",\n \"obj\",\n \"dae\",\n \"ifc\",\n\n // 🔧 System / Binary / Execution\n \"exe\",\n \"msi\",\n \"run\",\n \"com\",\n \"app\",\n \"elf\",\n \"dll\",\n \"so\",\n \"dylib\",\n \"sys\",\n \"scr\",\n \"bin\",\n \"out\",\n\n // 🔐 Certificates / Crypto\n \"pem\",\n \"crt\",\n \"cer\",\n \"der\",\n \"csr\",\n \"p12\",\n \"pfx\",\n \"jks\",\n \"asc\",\n \"gpg\",\n \"pgp\",\n \"p7b\",\n \"p7c\",\n \"spc\",\n \"key\",\n \"pub\",\n \"cert\",\n \"p7m\",\n\n // 🎮 Games & Projects\n \"nes\",\n \"sfc\",\n \"gba\",\n \"nds\",\n \"rom\",\n \"pak\",\n \"vpk\",\n \"bik\",\n \"cso\",\n \"wad\",\n \"wadx\",\n \"smc\",\n \"gb\",\n \"gbc\",\n\n // 🔬 Bioinformatics\n \"fasta\",\n \"fa\",\n \"fas\",\n \"ffn\",\n \"faa\",\n \"fna\",\n \"frn\",\n \"fastq\",\n \"fq\",\n \"bam\",\n \"bed\",\n \"sam\",\n \"vcf\",\n \"gff\",\n \"gff3\",\n \"gtf\",\n \"fai\",\n \"tbi\",\n \"fast5\",\n \"fqz\",\n \"fq5\"\n]);\n\n// ==========================\n// Double extensions\n// ==========================\nexport const DOUBLE_EXTENSIONS_FILE = new Set([\n \"log.gz\",\n \"tar.gz\",\n \"tar.bz2\",\n \"tar.bz\",\n \"tar.xz\",\n \"tar.lz\",\n \"tar.lzma\",\n \"tar.Z\",\n \"tar.zst\",\n \"tar.lz4\",\n \"log.gz\",\n \"sql.gz\",\n \"csv.gz\",\n \"tsv.gz\",\n \"json.gz\",\n \"ndjson.gz\",\n \"fq.gz\",\n \"sam.gz\",\n \"fasta.gz\",\n \"fa.gz\",\n \"ffn.gz\",\n \"faa.gz\",\n \"fna.gz\",\n \"frn.gz\",\n \"fastq.gz\",\n \"js.map\",\n \"css.map\"\n]);\n\n// ==========================\n// Special filenames\n// ==========================\nexport const SPECIAL_FILENAMES = new Set([\n \"Makefile\",\n \"Dockerfile\",\n \".dockerignore\",\n \".npmrc\",\n \".envrc\",\n \".htgroup\",\n \".eslintignore\",\n \".env.test\",\n \".env.local\",\n \".env.production\",\n \".env.development\",\n \".env.example\",\n \".dockerfile\",\n \".htaccess\",\n \".htpasswd\",\n \".babelrc\",\n \".eslintrc\",\n \".editorconfig\",\n \".prettierignore\",\n \"docker-compose.override.yml\",\n \"docker-compose.yml\",\n \"Vagrantfile\",\n \"Procfile\",\n \"Gemfile\",\n \"Rakefile\",\n \"package.json\",\n \"package-lock.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"tsconfig.json\",\n \"webpack.config.js\",\n \"vite.config.js\",\n \"vite.config.ts\",\n \"Gruntfile.js\",\n \"gulpfile.js\",\n \"babel.config.js\",\n \"babel.js\",\n \"rollup.js\",\n\n // SPECIAL PRESERVE NAME\n \"CON\",\n \"NUL\",\n \"PRN\",\n \"AUX\",\n \"COM1\",\n \"COM2\",\n \"COM3\",\n \"COM4\",\n \"COM5\",\n \"COM6\",\n \"COM7\",\n \"COM8\",\n \"COM9\",\n \"LPT1\",\n \"LPT2\",\n \"LPT3\",\n \"LPT4\",\n \"LPT5\",\n \"LPT6\",\n \"LPT7\",\n \"LPT8\",\n \"LPT9\"\n]);\n","import { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport {\n DOUBLE_EXTENSIONS_FILE,\n EXTENSIONS_FILE,\n SPECIAL_FILENAMES\n} from \"./_private/extensions\";\n\nimport { punycodeUtilsJS } from \"@/urls/utils/punyCode\";\n\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nexport type ExtractFileNameOptions = {\n /** ----------------------------------------------------------\n * * ***Indicates whether the input should be treated as a potential domain string.***\n * ----------------------------------------------------------\n *\n * - Behavior when `true`:\n * - The `domainName` option is required and must be a string and non-empty string.\n * If `domainName` is `undefined`, `null`, or an empty string, a `TypeError` will be thrown.\n * - The `domainName` is used to determine if the input is a domain-only string.\n * - Returns `null` if the input exactly matches `domainName` or any of its subdomains **and** has no additional path or filename.\n * - If the input does not match `domainName` or its subdomains, it will be processed as a regular file-like name.\n * - Supports **Unicode/IDN domains** (e.g., `tést-ドメイン.com`) and **ASCII filenames**, mixed safely.\n *\n * @default false\n */\n domainAware?: boolean;\n\n /** ----------------------------------------------------------\n * * ***The base domain name used for comparison (e.g., `\"example.com\"`).***\n * ----------------------------------------------------------\n *\n * - Required when `domainAware` is `true`.\n * - Helps differentiate between a domain-only input (ignored) and a standalone file-like string (processed normally).\n * - Must be a string and non-empty string. Invalid values (`undefined`, `null`, or empty string) will trigger a `TypeError`.\n * - Works with both **ASCII domains** and **Unicode/IDN domains**.\n * - Example:\n * ```ts *\n * // ASCII domain + ASCII filename\n * extractFileName(\"resume.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ \"resume\"\n * extractFileName(\"example.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ null (because input is treated as domain-name)\n *\n * // Unicode domain + ASCII filename\n * extractFileName(\"tést-ドメイン.com/file.txt\", {\n * domainAware: true,\n * domainName: \"ドメイン.com\"\n * });\n * // ➔ \"file\"\n *\n * // Unicode domain + Unicode filename\n * extractFileName(\"tést-ドメイン.com/ファイル名.pdf\", {\n * domainAware: true,\n * domainName: \"ドメイン.com\"\n * });\n * // ➔ \"ファイル名\"\n *\n * // Invalid domainName, will throw TypeError\n * extractFileName(\"resume.com\", {\n * domainAware: true,\n * domainName: \"\"\n * });\n * // ➔ TypeError\n * ```\n *\n * @default undefined\n */\n domainName?: string;\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `extractFileName`.***\n * ----------------------------------------------------------\n *\n * **Extracts the **clean base filename** from nearly any input string, including URLs, local file paths,\n * UNC paths, and plain filenames.**\n *\n * - It automatically safely handles extracts the **base file name** (without extension) from:\n * - File system paths (Windows, Unix, UNC)\n * - Protocols like http, https, ftp, file, mailto, or custom schemes\n * - Percent-encoded, Unicode, and emoji characters\n * - Dotfiles, reserved OS names, multi-part extensions\n * - Data URIs\n * - Optional domain-aware mode to ignore domain-only inputs\n * - Plain filenames\n *\n * - Full support for:\n * - Unicode, emoji, percent-encoding\n * - Dotfiles (e.g., `.env`, `.gitignore`)\n * - Reserved/OS-protected filenames:\n * `CON`, `PRN`, `AUX`, `NUL`, `COM1`–`COM9`, `LPT1`–`LPT9`\n * - Known multi-part extensions:\n * `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.lz`, `.tar.zst`, `.min.js`, `.js.map`, `.log.gz`, `.sql.gz`,\n * `.backup.tar`, etc.\n * - Data URIs (`data:[mime];base64,...` ➔ payload string)\n * - Domain-aware mode (optional)\n *\n * ----------------------------------------------------------\n * - **Behavior / Features**\n * - Strips **known extensions**, including multi-part and common double/triple extensions.\n * - Leaves unknown/custom extensions intact.\n * - Preserves **dotfiles** as-is (leading dot preserved).\n * - Returns `null` if:\n * - input is `null`, `undefined`, or not a string\n * - input is empty, whitespace-only, or only slashes\n * - input represents a folder path (trailing slash/backslash, drive/folder only)\n * - input is a **domain-only string** in domain-aware mode\n * - Normalizes Windows-style backslashes (`\\`) internally as `/`.\n * - Supports UNC paths, mixed slashes, and Windows drive letters safely.\n * - Handles URLs:\n * - Ignores query strings (`?v=1.2.3`) and hash fragments (`#section`)\n * - Decodes percent-encoded filenames (`my%20file.txt` ➔ `my file.txt`)\n * - Supports protocol-relative URLs (`//cdn.example.com/file.jpg`)\n * - Supports uncommon/custom protocols (`ftp://`, `file://`, `mailto:`, etc.)\n * - Handles **multiple dots**, **trailing dots**, **triple or more extensions**\n * - Supports filenames on mixed Unicode/ASCII domains:\n * - Domain names can include Unicode characters (IDN / punycode)\n * - Filenames may contain ASCII, Unicode, and emoji characters\n * - Works correctly when domain is Unicode and filename is ASCII, or vice versa\n * - Supports extremely long filenames safely (up to OS limits)\n * - Domain-aware mode (`domainAware: true` + `domainName`):\n * - Parameter `domainName` must be a string and non-empty string; otherwise a TypeError is thrown.\n * - Returns `null` if input equals `domainName` or any subdomain with no file path\n * - Extracts filename normally if path/file exists on domain or other domain\n * - Safe in Node.js and browsers\n *\n * ----------------------------------------------------------\n * @param {string | null | undefined} input\n * URL, file path, or plain filename to extract from.\n *\n * @param {ExtractFileNameOptions} [options]\n * Optional configuration:\n * - `domainAware?: boolean` – treat input as a domain string. Requires `domainName` to be a string and non-empty string; otherwise, a TypeError is thrown.\n * - `domainName?: string` – base domain for comparison eg (`example.com`), required when `domainAware` is true.\n *\n * @returns {string | null}\n * - Base filename without known extensions\n * - Original filename if extension unknown\n * - `null` for invalid inputs, folder paths, or domain-only strings\n *\n * ----------------------------------------------------------\n * @example\n * ```ts\n * // Basic files\n * extractFileName(\"document.pdf\"); // ➔ \"document\"\n * extractFileName(\"/files/archive.tar.gz\"); // ➔ \"archive\"\n * extractFileName(\"C:\\\\path\\\\file.txt\"); // ➔ \"file\"\n * extractFileName(\".env\"); // ➔ \".env\"\n * extractFileName(\"folder/\"); // ➔ null\n *\n * // Not a file\n * extractFileName(\"not-file\"); // ➔ null\n * extractFileName(\"not-file/\"); // ➔ null\n * extractFileName(\"/not-file/\"); // ➔ null\n * extractFileName(\"/not-file\"); // ➔ null\n *\n * // URLs with queries, hashes, protocols\n * extractFileName(\"https://example.com/file.txt?ver=1\"); // ➔ \"file\"\n * extractFileName(\"https://example.com/archive.tar.gz#part\"); // ➔ \"archive\"\n * extractFileName(\"//cdn.example.com/image.png\"); // ➔ \"image\"\n *\n *\n * // Special protocol handling\n * extractFileName(\"tel:+6212345678\"); // ➔ \"+6212345678\"\n * extractFileName(\"sms:+6212345678\"); // ➔ \"+6212345678\"\n * extractFileName(\"mailto:user@domain.com\"); // ➔ \"user@domain\"\n * extractFileName(\"data:text/plain;base64,SGVsbG8=\"); // ➔ \"SGVsbG8=\"\n * extractFileName(\"mailto:resume.com\"); // ➔ \"resume\"\n * extractFileName(\"ftp://example.com/image.jpeg\"); // ➔ \"image\"\n * extractFileName(\"ftp://files.example.com/app.min.js\"); // ➔ \"app.min\"\n * extractFileName(\"file:///C:/path/to/document.pdf\"); // ➔ \"document\"\n * extractFileName(\"custom-scheme://example.com/video.mp4\"); // ➔ \"video\"\n *\n * // Unicode & emoji\n * extractFileName(\"emoji-😊.png\"); // ➔ \"emoji-😊\"\n * extractFileName(\"🔥project.tar.gz\"); // ➔ \"🔥project\"\n *\n * // Dotfiles\n * extractFileName(\".gitignore\"); // ➔ \".gitignore\"\n * extractFileName(\"/path/.bashrc\"); // ➔ \".bashrc\"\n *\n * // Mixed Unicode domain and ASCII filename\n * extractFileName(\"https://tést-ドメイン.com/file.txt\"); // ➔ \"file\"\n * extractFileName(\"https://example.com/ファイル名.pdf\"); // ➔ \"ファイル名\"\n * extractFileName(\"https://ドメイン例.com/emoji-🔥.png\"); // ➔ \"emoji-🔥\"\n *\n * // Reserved filenames\n * extractFileName(\"CON\"); // ➔ \"CON\"\n * extractFileName(\"NUL.txt\"); // ➔ \"NUL\"\n *\n * // Domain-aware mode\n * extractFileName(\"example.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ null\n * extractFileName(\"cdn.example.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ null\n * extractFileName(\"resume.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ \"resume\"\n * extractFileName(\"https://example.com/file.txt\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ \"file\"\n *\n * // Windows & UNC paths\n * extractFileName(\"C:\\\\Users\\\\rzl\\\\Documents\\\\file.txt\"); // ➔ \"file\"\n * extractFileName(\"\\\\\\\\SERVER\\\\share\\\\logs\\\\output.log\"); // ➔ \"output\"\n * extractFileName(\"C:/Users\\\\rzl/mix\\\\test.pdf\"); // ➔ \"test\"\n *\n * // Edge / extreme cases\n * extractFileName(\"https://example.com/my%20file%20name.txt\"); // ➔ \"my file name\"\n * extractFileName(\"app.min.js.map\"); // ➔ \"app.min\"\n * extractFileName(\"backup.tar.bak\"); // ➔ \"backup.tar.bak\" (unknown double extension)\n * extractFileName(\"filename.\"); // ➔ \"filename.\"\n * extractFileName(\"a\".repeat(255) + \".txt\"); // ➔ \"a\".repeat(255)\n * ```\n *\n * ----------------------------------------------------------\n * @note\n * - Robust: never throws, handles unusual inputs safely.\n * - Suitable for display, logging, or safe storage.\n * - Normalizes slashes consistently.\n * - Covers nearly all real-world filename, URL, path, data URI, and domain scenarios.\n * - Handles Windows UNC paths, mixed slashes, percent-encoded, Unicode/emoji filenames.\n * - Known multi-part extensions list can be extended without breaking functionality.\n */\nexport const extractFileName = (\n input?: string | null,\n options: ExtractFileNameOptions = {}\n): string | null => {\n if (!isNonEmptyString(input)) return null;\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const { domainName, domainAware = false } = options;\n\n assertIsBoolean(domainAware, {\n message: ({ currentType, validType }) =>\n `Parameter \\`domainAware\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n let pathname = input.trim();\n\n // Normalize Windows backslashes\n pathname = pathname.replace(/\\\\/g, \"/\");\n\n // domain-aware mode\n if (domainAware) {\n if (!isNonEmptyString(domainName)) {\n throw new TypeError(\n \"If parameter `domainAware` is set to `true`, the option parameter `domainName` is required as string, and cant be an empty-string.\"\n );\n }\n\n const cleanDomain = punycodeUtilsJS\n .toASCII(domainName)\n .replace(/^https?:\\/\\//i, \"\")\n .replace(/^www\\./, \"\")\n .replace(/\\/.*$/, \"\")\n .toLowerCase();\n\n const inputDomain = punycodeUtilsJS\n .toASCII(input)\n .replace(/^https?:\\/\\//i, \"\")\n .replace(/^www\\./, \"\")\n .toLowerCase();\n\n const inputHost = inputDomain.split(\"/\")[0]?.split(/[?#]/)[0];\n const matchesDomain =\n inputHost === cleanDomain || inputHost?.endsWith(`.${cleanDomain}`);\n const hasPath = /\\/[^/]+$/.test(inputDomain);\n\n if (matchesDomain && !hasPath) return null;\n }\n\n // handle special protocol-like strings\n const protocolMatch = pathname.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):(.+)$/);\n if (protocolMatch) {\n const scheme = protocolMatch[1]?.toLowerCase() || \"\";\n const rest = protocolMatch[2];\n\n if ([\"tel\", \"sms\"].some((sch) => sch.startsWith(scheme))) {\n const clean = rest?.split(\"?\")[0]?.split(\"#\")[0];\n return clean?.trim() || null;\n } else if (scheme === \"mailto\") {\n const parts = rest?.split(\"/\");\n let last = parts?.[parts.length - 1];\n last = last?.split(\"?\")[0]?.split(\"#\")[0]; // strip query/hash\n const dotIndex = last?.lastIndexOf(\".\");\n if (dotIndex && dotIndex > 0) last = last?.slice(0, dotIndex);\n return last || null;\n } else if (scheme === \"data\") {\n const commaIndex = rest?.indexOf(\",\") || -1;\n if (commaIndex === -1) return null;\n let payload = rest?.slice(commaIndex + 1);\n payload = payload?.split?.(\"?\")[0]?.split(\"#\")[0]; // strip query/hash\n return payload?.trim() || null;\n }\n }\n\n if (/^[a-z][a-z\\d+\\-.]*:\\/{3,}/i.test(pathname)) {\n // eg https:///file.txt (has more than 2 slash after : protocol)\n pathname = pathname.replace(/^[a-z][a-z\\d+\\-.]*:\\/{2,}/i, \"\");\n } else {\n try {\n const isProbablyUrl = /^[a-z][a-z\\d+\\-.]*:(\\/\\/)?/i.test(pathname);\n\n pathname = isProbablyUrl\n ? new URL(pathname).pathname\n : new URL(`http://localhost/${pathname}`).pathname;\n } catch {\n // Fallback for weird URLs like 'https:///file.txt'\n // Remove protocol + any number of slashes\n pathname = pathname.replace(/^[a-z][a-z\\d+\\-.]*:(\\/\\/)?/i, \"\");\n }\n }\n\n // split into non-empty segments\n const segments = pathname.split(\"/\").filter(Boolean);\n\n if (segments.length === 0) return null;\n\n // Take the last segment as candidate filename\n let lastSegment =\n segments[segments.length - 1]?.split(\"?\")[0]?.split(\"#\")[0] || \"\";\n // Strip trailing ? or # that is alone\n lastSegment = lastSegment?.replace(/[?#]+$/, \"\");\n if (!lastSegment) return null;\n\n // Replace encoded slashes and dots\n lastSegment = lastSegment\n .replace(/%2F/gi, \"/\")\n .replace(/%5C/gi, \"\\\\\")\n .replace(/%2E/gi, \".\");\n\n // If replacement introduces new slashes, take the new last segment\n if (lastSegment.includes(\"/\")) {\n const parts = lastSegment.split(\"/\").filter(Boolean);\n lastSegment = parts[parts.length - 1] || \"\";\n }\n\n let filename = decodeURIComponent(lastSegment);\n\n if (!filename) return null;\n\n // Special filenames always returned as-is (even if trailing slash)\n if (SPECIAL_FILENAMES.has(filename)) return filename;\n\n // Dotfiles like \".env\" should be returned as-is (single leading dot, no other dot)\n if (/^\\.[^.\\s][^/]*$/.test(filename)) return filename;\n\n // If the original pathname ends with \"/\" and the last segment doesn't look like a file\n // const originalEndsWithSlash = pathname.endsWith(\"/\");\n if (!filename.includes(\".\")) return null;\n\n // Strip double extensions first\n const sortedDouble = [...DOUBLE_EXTENSIONS_FILE].sort(\n (a, b) => b.length - a.length\n );\n for (const ext of sortedDouble) {\n const dotExt = `.${ext.toLowerCase()}`;\n if (filename.toLowerCase().endsWith(dotExt)) {\n filename = filename.slice(0, filename.length - dotExt.length);\n break;\n }\n }\n\n // Strip single extensions\n const sortedSingle = [...EXTENSIONS_FILE].sort((a, b) => b.length - a.length);\n for (const ext of sortedSingle) {\n const dotExt = `.${ext.toLowerCase()}`;\n if (filename.toLowerCase().endsWith(dotExt)) {\n filename = filename.slice(0, filename.length - dotExt.length);\n break;\n }\n }\n\n return filename || null;\n};\n"],"mappings":";;;;;;;;;;;;;;AAGA,MAAa,kBAAkB,IAAI,IAAI;CAErC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAIA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAKD,MAAa,yBAAyB,IAAI,IAAI;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAKD,MAAa,oBAAoB,IAAI,IAAI;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnWD,MAAa,mBACX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,CAAC,UAAU,OAAO;CAGtB,IAAI,kBAAkB,IAAI,QAAQ,GAAG,OAAO;CAG5C,IAAI,kBAAkB,KAAK,QAAQ,GAAG,OAAO;CAI7C,IAAI,CAAC,SAAS,SAAS,GAAG,GAAG,OAAO;CAGpC,MAAM,eAAe,CAAC,GAAG,sBAAsB,EAAE,MAC9C,GAAG,MAAM,EAAE,SAAS,EAAE,MACzB;CACA,KAAK,MAAM,OAAO,cAAc;EAC9B,MAAM,SAAS,IAAI,IAAI,YAAY;EACnC,IAAI,SAAS,YAAY,EAAE,SAAS,MAAM,GAAG;GAC3C,WAAW,SAAS,MAAM,GAAG,SAAS,SAAS,OAAO,MAAM;GAC5D;EACF;CACF;CAGA,MAAM,eAAe,CAAC,GAAG,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM;CAC5E,KAAK,MAAM,OAAO,cAAc;EAC9B,MAAM,SAAS,IAAI,IAAI,YAAY;EACnC,IAAI,SAAS,YAAY,EAAE,SAAS,MAAM,GAAG;GAC3C,WAAW,SAAS,MAAM,GAAG,SAAS,SAAS,OAAO,MAAM;GAC5D;EACF;CACF;CAEA,OAAO,YAAY;AACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parsers-B_FPX35n.cjs","names":["isNonEmptyString","punycodeUtilsJS"],"sources":["../src/parsers/_private/extensions.ts","../src/parsers/extractFileName.ts"],"sourcesContent":["// ==========================\n// Single extensions\n// ==========================\nexport const EXTENSIONS_FILE = new Set([\n // 📄 Text & Document\n \"txt\",\n \"md\",\n \"rtf\",\n \"tex\",\n \"doc\",\n \"docx\",\n \"odt\",\n \"ott\",\n \"pdf\",\n \"djvu\",\n \"epub\",\n \"fb2\",\n \"lit\",\n \"lrf\",\n \"xls\",\n \"xlsx\",\n \"ods\",\n \"csv\",\n \"tsv\",\n \"ppt\",\n \"pptx\",\n \"pps\",\n \"bib\",\n \"cba\",\n \"cbt\",\n \"cbz\",\n \"cbr\",\n \"opds\",\n \"fodt\",\n \"pages\",\n \"rtfd\",\n \"sxc\",\n \"sxw\",\n \"wpd\",\n \"xps\",\n \"dotx\",\n \"dotm\",\n \"xltx\",\n \"xltm\",\n \"sldx\",\n \"sldm\",\n \"fods\",\n \"mdx\",\n \"markdown\",\n \"texi\",\n \"textile\",\n\n // 🖼️ Image\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"gif\",\n \"bmp\",\n \"tif\",\n \"tiff\",\n \"webp\",\n \"svg\",\n \"ico\",\n \"heif\",\n \"heic\",\n \"raw\",\n \"cr2\",\n \"nef\",\n \"orf\",\n \"sr2\",\n \"dng\",\n \"dds\",\n \"psd\",\n \"exr\",\n \"xcf\",\n \"ai\",\n \"eps\",\n \"cdr\",\n \"indd\",\n \"pcx\",\n \"pgm\",\n \"ppm\",\n \"pbm\",\n \"pnm\",\n \"jfif\",\n \"ras\",\n \"tga\",\n \"j2k\",\n \"jp2\",\n \"emf\",\n \"wmf\",\n \"hdp\",\n \"mdi\",\n \"hevc\",\n\n // 🎵 Audio\n \"mp3\",\n \"wav\",\n \"ogg\",\n \"flac\",\n \"aac\",\n \"m4a\",\n \"wma\",\n \"alac\",\n \"aiff\",\n \"aif\",\n \"amr\",\n \"mid\",\n \"midi\",\n \"opus\",\n \"au\",\n \"caf\",\n \"ape\",\n \"mka\",\n \"spx\",\n \"ra\",\n \"ram\",\n \"mpc\",\n \"wv\",\n \"aifc\",\n \"mod\",\n \"it\",\n \"s3m\",\n \"xm\",\n \"kar\",\n \"m4b\",\n \"voc\",\n \"snd\",\n \"a52\",\n \"ac3\",\n \"dts\",\n\n // 🎥 Video\n \"mp4\",\n \"mkv\",\n \"avi\",\n \"mov\",\n \"wmv\",\n \"webm\",\n \"mpeg\",\n \"mpg\",\n \"3gp\",\n \"3g2\",\n \"m4v\",\n \"ts\",\n \"mts\",\n \"asf\",\n \"rm\",\n \"rmvb\",\n \"vob\",\n \"f4v\",\n \"ogv\",\n \"m2ts\",\n \"dav\",\n \"mxf\",\n \"mjpeg\",\n \"flv\",\n \"divx\",\n \"f4a\",\n \"f4p\",\n \"m2v\",\n \"ogm\",\n \"vp8\",\n \"vp9\",\n \"xvid\",\n \"yuv\",\n \"mng\",\n \"dv\",\n \"m1v\",\n \"roq\",\n \"m2t\",\n \"av1\",\n \"hevc\",\n \"m3u\",\n \"m3u8\",\n\n // 🗃️ Archive & Compression\n \"zip\",\n \"rar\",\n \"7z\",\n \"tar\",\n \"gz\",\n \"bz\",\n \"bz2\",\n \"xz\",\n \"tgz\",\n \"tbz2\",\n \"txz\",\n \"lz\",\n \"lzma\",\n \"z\",\n \"cab\",\n \"arj\",\n \"ace\",\n \"rpm\",\n \"deb\",\n \"pkg\",\n \"apk\",\n \"jar\",\n \"war\",\n \"ear\",\n \"sit\",\n \"sitx\",\n \"cpgz\",\n \"tlz\",\n \"tlzma\",\n \"tzo\",\n \"cpio\",\n \"shar\",\n \"bzip\",\n \"gzip\",\n \"7zip\",\n \"rar5\",\n \"tbz\",\n \"txz\",\n\n // 💾 Disk Image\n \"iso\",\n \"img\",\n \"vhd\",\n \"vmdk\",\n \"qcow2\",\n \"vhdx\",\n \"bin\",\n \"cue\",\n \"nrg\",\n \"daa\",\n \"sdi\",\n \"vfd\",\n \"ima\",\n \"dmg\",\n \"vdi\",\n \"toast\",\n \"ccd\",\n \"mdf\",\n \"cdi\",\n \"bif\",\n \"bifc\",\n \"bifd\",\n\n // 🗃️ Database & Data\n \"sql\",\n \"db\",\n \"dbf\",\n \"mdb\",\n \"accdb\",\n \"json\",\n \"toml\",\n \"ini\",\n \"log\",\n \"plist\",\n \"pkl\",\n \"msgpack\",\n \"h5\",\n \"hdf5\",\n \"parquet\",\n \"avro\",\n \"orc\",\n \"ndjson\",\n \"pdb\",\n \"sqlite\",\n \"sqlite3\",\n \"dbx\",\n \"sdf\",\n \"nc\",\n \"netcdf\",\n \"grib\",\n \"geojson\",\n \"gml\",\n \"hjson\",\n \"cdb\",\n \"db3\",\n \"dta\",\n \"sav\",\n \"sas7bdat\",\n \"ldif\",\n \"fdb\",\n \"gdb\",\n \"sqlite2\",\n \"h5ad\",\n \"nc4\",\n \"xmind\",\n \"drawio\",\n \"sdc\",\n \"jsonl\",\n \"yaml\",\n \"yml\",\n \"toml\",\n\n // 💻 Code & Script\n \"js\",\n \"jsx\",\n \"ts\",\n \"tsx\",\n \"c\",\n \"cpp\",\n \"net\",\n \"h\",\n \"hpp\",\n \"java\",\n \"py\",\n \"rb\",\n \"go\",\n \"rs\",\n \"php\",\n \"pl\",\n \"sh\",\n \"bat\",\n \"cmd\",\n \"ps1\",\n \"lua\",\n \"swift\",\n \"kt\",\n \"scala\",\n \"cs\",\n \"vb\",\n \"dart\",\n \"m\",\n \"r\",\n \"jl\",\n \"fs\",\n \"vbproj\",\n \"sln\",\n \"pri\",\n \"gemspec\",\n \"gradle\",\n \"coffee\",\n \"erl\",\n \"ex\",\n \"exs\",\n \"hs\",\n \"lisp\",\n \"clj\",\n \"groovy\",\n \"scm\",\n \"vbs\",\n \"nim\",\n \"rkt\",\n \"ml\",\n \"mli\",\n \"fsx\",\n \"psm1\",\n \"cbl\",\n \"for\",\n \"f90\",\n \"lock\",\n \"tsconfig\",\n \"vue\",\n \"svelte\",\n \"cjs\",\n \"mjs\",\n \"mts\",\n \"cts\",\n \"json5\",\n \"es6\",\n \"module\",\n \"systemjs\",\n\n // 🌐 Web & Config\n \"html\",\n \"htm\",\n \"xhtml\",\n \"css\",\n \"scss\",\n \"sass\",\n \"less\",\n \"xml\",\n \"xlf\",\n \"po\",\n \"pot\",\n \"jsp\",\n \"asp\",\n \"aspx\",\n \"jspf\",\n \"cgi\",\n \"cfm\",\n \"env\",\n \"babelrc\",\n \"cfg\",\n \"config\",\n \"conf\",\n \"editorconfig\",\n \"eslintrc\",\n \"gitconfig\",\n \"gitattributes\",\n \"gitignore\",\n \"prettierrc\",\n \"webmanifest\",\n \"dockerfile\",\n // \".dockerfile\",\n\n // 🔠 Font\n \"ttf\",\n \"otf\",\n \"woff\",\n \"woff2\",\n \"eot\",\n \"dfont\",\n \"pfa\",\n \"pfb\",\n \"fon\",\n \"fnt\",\n \"bdf\",\n \"ps\",\n\n // 🗺️ CAD & GIS\n \"dwg\",\n \"dxf\",\n \"shp\",\n \"kml\",\n \"kmz\",\n \"gpx\",\n \"stl\",\n \"step\",\n \"iges\",\n \"igs\",\n \"3ds\",\n \"3dm\",\n \"fbx\",\n \"obj\",\n \"dae\",\n \"ifc\",\n\n // 🔧 System / Binary / Execution\n \"exe\",\n \"msi\",\n \"run\",\n \"com\",\n \"app\",\n \"elf\",\n \"dll\",\n \"so\",\n \"dylib\",\n \"sys\",\n \"scr\",\n \"bin\",\n \"out\",\n\n // 🔐 Certificates / Crypto\n \"pem\",\n \"crt\",\n \"cer\",\n \"der\",\n \"csr\",\n \"p12\",\n \"pfx\",\n \"jks\",\n \"asc\",\n \"gpg\",\n \"pgp\",\n \"p7b\",\n \"p7c\",\n \"spc\",\n \"key\",\n \"pub\",\n \"cert\",\n \"p7m\",\n\n // 🎮 Games & Projects\n \"nes\",\n \"sfc\",\n \"gba\",\n \"nds\",\n \"rom\",\n \"pak\",\n \"vpk\",\n \"bik\",\n \"cso\",\n \"wad\",\n \"wadx\",\n \"smc\",\n \"gb\",\n \"gbc\",\n\n // 🔬 Bioinformatics\n \"fasta\",\n \"fa\",\n \"fas\",\n \"ffn\",\n \"faa\",\n \"fna\",\n \"frn\",\n \"fastq\",\n \"fq\",\n \"bam\",\n \"bed\",\n \"sam\",\n \"vcf\",\n \"gff\",\n \"gff3\",\n \"gtf\",\n \"fai\",\n \"tbi\",\n \"fast5\",\n \"fqz\",\n \"fq5\"\n]);\n\n// ==========================\n// Double extensions\n// ==========================\nexport const DOUBLE_EXTENSIONS_FILE = new Set([\n \"log.gz\",\n \"tar.gz\",\n \"tar.bz2\",\n \"tar.bz\",\n \"tar.xz\",\n \"tar.lz\",\n \"tar.lzma\",\n \"tar.Z\",\n \"tar.zst\",\n \"tar.lz4\",\n \"log.gz\",\n \"sql.gz\",\n \"csv.gz\",\n \"tsv.gz\",\n \"json.gz\",\n \"ndjson.gz\",\n \"fq.gz\",\n \"sam.gz\",\n \"fasta.gz\",\n \"fa.gz\",\n \"ffn.gz\",\n \"faa.gz\",\n \"fna.gz\",\n \"frn.gz\",\n \"fastq.gz\",\n \"js.map\",\n \"css.map\"\n]);\n\n// ==========================\n// Special filenames\n// ==========================\nexport const SPECIAL_FILENAMES = new Set([\n \"Makefile\",\n \"Dockerfile\",\n \".dockerignore\",\n \".npmrc\",\n \".envrc\",\n \".htgroup\",\n \".eslintignore\",\n \".env.test\",\n \".env.local\",\n \".env.production\",\n \".env.development\",\n \".env.example\",\n \".dockerfile\",\n \".htaccess\",\n \".htpasswd\",\n \".babelrc\",\n \".eslintrc\",\n \".editorconfig\",\n \".prettierignore\",\n \"docker-compose.override.yml\",\n \"docker-compose.yml\",\n \"Vagrantfile\",\n \"Procfile\",\n \"Gemfile\",\n \"Rakefile\",\n \"package.json\",\n \"package-lock.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"tsconfig.json\",\n \"webpack.config.js\",\n \"vite.config.js\",\n \"vite.config.ts\",\n \"Gruntfile.js\",\n \"gulpfile.js\",\n \"babel.config.js\",\n \"babel.js\",\n \"rollup.js\",\n\n // SPECIAL PRESERVE NAME\n \"CON\",\n \"NUL\",\n \"PRN\",\n \"AUX\",\n \"COM1\",\n \"COM2\",\n \"COM3\",\n \"COM4\",\n \"COM5\",\n \"COM6\",\n \"COM7\",\n \"COM8\",\n \"COM9\",\n \"LPT1\",\n \"LPT2\",\n \"LPT3\",\n \"LPT4\",\n \"LPT5\",\n \"LPT6\",\n \"LPT7\",\n \"LPT8\",\n \"LPT9\"\n]);\n","import { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport {\n DOUBLE_EXTENSIONS_FILE,\n EXTENSIONS_FILE,\n SPECIAL_FILENAMES\n} from \"./_private/extensions\";\n\nimport { punycodeUtilsJS } from \"@/urls/utils/punyCode\";\n\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nexport type ExtractFileNameOptions = {\n /** ----------------------------------------------------------\n * * ***Indicates whether the input should be treated as a potential domain string.***\n * ----------------------------------------------------------\n *\n * - Behavior when `true`:\n * - The `domainName` option is required and must be a string and non-empty string.\n * If `domainName` is `undefined`, `null`, or an empty string, a `TypeError` will be thrown.\n * - The `domainName` is used to determine if the input is a domain-only string.\n * - Returns `null` if the input exactly matches `domainName` or any of its subdomains **and** has no additional path or filename.\n * - If the input does not match `domainName` or its subdomains, it will be processed as a regular file-like name.\n * - Supports **Unicode/IDN domains** (e.g., `tést-ドメイン.com`) and **ASCII filenames**, mixed safely.\n *\n * @default false\n */\n domainAware?: boolean;\n\n /** ----------------------------------------------------------\n * * ***The base domain name used for comparison (e.g., `\"example.com\"`).***\n * ----------------------------------------------------------\n *\n * - Required when `domainAware` is `true`.\n * - Helps differentiate between a domain-only input (ignored) and a standalone file-like string (processed normally).\n * - Must be a string and non-empty string. Invalid values (`undefined`, `null`, or empty string) will trigger a `TypeError`.\n * - Works with both **ASCII domains** and **Unicode/IDN domains**.\n * - Example:\n * ```ts *\n * // ASCII domain + ASCII filename\n * extractFileName(\"resume.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ \"resume\"\n * extractFileName(\"example.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ null (because input is treated as domain-name)\n *\n * // Unicode domain + ASCII filename\n * extractFileName(\"tést-ドメイン.com/file.txt\", {\n * domainAware: true,\n * domainName: \"ドメイン.com\"\n * });\n * // ➔ \"file\"\n *\n * // Unicode domain + Unicode filename\n * extractFileName(\"tést-ドメイン.com/ファイル名.pdf\", {\n * domainAware: true,\n * domainName: \"ドメイン.com\"\n * });\n * // ➔ \"ファイル名\"\n *\n * // Invalid domainName, will throw TypeError\n * extractFileName(\"resume.com\", {\n * domainAware: true,\n * domainName: \"\"\n * });\n * // ➔ TypeError\n * ```\n *\n * @default undefined\n */\n domainName?: string;\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `extractFileName`.***\n * ----------------------------------------------------------\n *\n * **Extracts the **clean base filename** from nearly any input string, including URLs, local file paths,\n * UNC paths, and plain filenames.**\n *\n * - It automatically safely handles extracts the **base file name** (without extension) from:\n * - File system paths (Windows, Unix, UNC)\n * - Protocols like http, https, ftp, file, mailto, or custom schemes\n * - Percent-encoded, Unicode, and emoji characters\n * - Dotfiles, reserved OS names, multi-part extensions\n * - Data URIs\n * - Optional domain-aware mode to ignore domain-only inputs\n * - Plain filenames\n *\n * - Full support for:\n * - Unicode, emoji, percent-encoding\n * - Dotfiles (e.g., `.env`, `.gitignore`)\n * - Reserved/OS-protected filenames:\n * `CON`, `PRN`, `AUX`, `NUL`, `COM1`–`COM9`, `LPT1`–`LPT9`\n * - Known multi-part extensions:\n * `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.lz`, `.tar.zst`, `.min.js`, `.js.map`, `.log.gz`, `.sql.gz`,\n * `.backup.tar`, etc.\n * - Data URIs (`data:[mime];base64,...` ➔ payload string)\n * - Domain-aware mode (optional)\n *\n * ----------------------------------------------------------\n * - **Behavior / Features**\n * - Strips **known extensions**, including multi-part and common double/triple extensions.\n * - Leaves unknown/custom extensions intact.\n * - Preserves **dotfiles** as-is (leading dot preserved).\n * - Returns `null` if:\n * - input is `null`, `undefined`, or not a string\n * - input is empty, whitespace-only, or only slashes\n * - input represents a folder path (trailing slash/backslash, drive/folder only)\n * - input is a **domain-only string** in domain-aware mode\n * - Normalizes Windows-style backslashes (`\\`) internally as `/`.\n * - Supports UNC paths, mixed slashes, and Windows drive letters safely.\n * - Handles URLs:\n * - Ignores query strings (`?v=1.2.3`) and hash fragments (`#section`)\n * - Decodes percent-encoded filenames (`my%20file.txt` ➔ `my file.txt`)\n * - Supports protocol-relative URLs (`//cdn.example.com/file.jpg`)\n * - Supports uncommon/custom protocols (`ftp://`, `file://`, `mailto:`, etc.)\n * - Handles **multiple dots**, **trailing dots**, **triple or more extensions**\n * - Supports filenames on mixed Unicode/ASCII domains:\n * - Domain names can include Unicode characters (IDN / punycode)\n * - Filenames may contain ASCII, Unicode, and emoji characters\n * - Works correctly when domain is Unicode and filename is ASCII, or vice versa\n * - Supports extremely long filenames safely (up to OS limits)\n * - Domain-aware mode (`domainAware: true` + `domainName`):\n * - Parameter `domainName` must be a string and non-empty string; otherwise a TypeError is thrown.\n * - Returns `null` if input equals `domainName` or any subdomain with no file path\n * - Extracts filename normally if path/file exists on domain or other domain\n * - Safe in Node.js and browsers\n *\n * ----------------------------------------------------------\n * @param {string | null | undefined} input\n * URL, file path, or plain filename to extract from.\n *\n * @param {ExtractFileNameOptions} [options]\n * Optional configuration:\n * - `domainAware?: boolean` – treat input as a domain string. Requires `domainName` to be a string and non-empty string; otherwise, a TypeError is thrown.\n * - `domainName?: string` – base domain for comparison eg (`example.com`), required when `domainAware` is true.\n *\n * @returns {string | null}\n * - Base filename without known extensions\n * - Original filename if extension unknown\n * - `null` for invalid inputs, folder paths, or domain-only strings\n *\n * ----------------------------------------------------------\n * @example\n * ```ts\n * // Basic files\n * extractFileName(\"document.pdf\"); // ➔ \"document\"\n * extractFileName(\"/files/archive.tar.gz\"); // ➔ \"archive\"\n * extractFileName(\"C:\\\\path\\\\file.txt\"); // ➔ \"file\"\n * extractFileName(\".env\"); // ➔ \".env\"\n * extractFileName(\"folder/\"); // ➔ null\n *\n * // Not a file\n * extractFileName(\"not-file\"); // ➔ null\n * extractFileName(\"not-file/\"); // ➔ null\n * extractFileName(\"/not-file/\"); // ➔ null\n * extractFileName(\"/not-file\"); // ➔ null\n *\n * // URLs with queries, hashes, protocols\n * extractFileName(\"https://example.com/file.txt?ver=1\"); // ➔ \"file\"\n * extractFileName(\"https://example.com/archive.tar.gz#part\"); // ➔ \"archive\"\n * extractFileName(\"//cdn.example.com/image.png\"); // ➔ \"image\"\n *\n *\n * // Special protocol handling\n * extractFileName(\"tel:+6212345678\"); // ➔ \"+6212345678\"\n * extractFileName(\"sms:+6212345678\"); // ➔ \"+6212345678\"\n * extractFileName(\"mailto:user@domain.com\"); // ➔ \"user@domain\"\n * extractFileName(\"data:text/plain;base64,SGVsbG8=\"); // ➔ \"SGVsbG8=\"\n * extractFileName(\"mailto:resume.com\"); // ➔ \"resume\"\n * extractFileName(\"ftp://example.com/image.jpeg\"); // ➔ \"image\"\n * extractFileName(\"ftp://files.example.com/app.min.js\"); // ➔ \"app.min\"\n * extractFileName(\"file:///C:/path/to/document.pdf\"); // ➔ \"document\"\n * extractFileName(\"custom-scheme://example.com/video.mp4\"); // ➔ \"video\"\n *\n * // Unicode & emoji\n * extractFileName(\"emoji-😊.png\"); // ➔ \"emoji-😊\"\n * extractFileName(\"🔥project.tar.gz\"); // ➔ \"🔥project\"\n *\n * // Dotfiles\n * extractFileName(\".gitignore\"); // ➔ \".gitignore\"\n * extractFileName(\"/path/.bashrc\"); // ➔ \".bashrc\"\n *\n * // Mixed Unicode domain and ASCII filename\n * extractFileName(\"https://tést-ドメイン.com/file.txt\"); // ➔ \"file\"\n * extractFileName(\"https://example.com/ファイル名.pdf\"); // ➔ \"ファイル名\"\n * extractFileName(\"https://ドメイン例.com/emoji-🔥.png\"); // ➔ \"emoji-🔥\"\n *\n * // Reserved filenames\n * extractFileName(\"CON\"); // ➔ \"CON\"\n * extractFileName(\"NUL.txt\"); // ➔ \"NUL\"\n *\n * // Domain-aware mode\n * extractFileName(\"example.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ null\n * extractFileName(\"cdn.example.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ null\n * extractFileName(\"resume.com\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ \"resume\"\n * extractFileName(\"https://example.com/file.txt\", {\n * domainAware: true,\n * domainName: \"example.com\"\n * });\n * // ➔ \"file\"\n *\n * // Windows & UNC paths\n * extractFileName(\"C:\\\\Users\\\\rzl\\\\Documents\\\\file.txt\"); // ➔ \"file\"\n * extractFileName(\"\\\\\\\\SERVER\\\\share\\\\logs\\\\output.log\"); // ➔ \"output\"\n * extractFileName(\"C:/Users\\\\rzl/mix\\\\test.pdf\"); // ➔ \"test\"\n *\n * // Edge / extreme cases\n * extractFileName(\"https://example.com/my%20file%20name.txt\"); // ➔ \"my file name\"\n * extractFileName(\"app.min.js.map\"); // ➔ \"app.min\"\n * extractFileName(\"backup.tar.bak\"); // ➔ \"backup.tar.bak\" (unknown double extension)\n * extractFileName(\"filename.\"); // ➔ \"filename.\"\n * extractFileName(\"a\".repeat(255) + \".txt\"); // ➔ \"a\".repeat(255)\n * ```\n *\n * ----------------------------------------------------------\n * @note\n * - Robust: never throws, handles unusual inputs safely.\n * - Suitable for display, logging, or safe storage.\n * - Normalizes slashes consistently.\n * - Covers nearly all real-world filename, URL, path, data URI, and domain scenarios.\n * - Handles Windows UNC paths, mixed slashes, percent-encoded, Unicode/emoji filenames.\n * - Known multi-part extensions list can be extended without breaking functionality.\n */\nexport const extractFileName = (\n input?: string | null,\n options: ExtractFileNameOptions = {}\n): string | null => {\n if (!isNonEmptyString(input)) return null;\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const { domainName, domainAware = false } = options;\n\n assertIsBoolean(domainAware, {\n message: ({ currentType, validType }) =>\n `Parameter \\`domainAware\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n let pathname = input.trim();\n\n // Normalize Windows backslashes\n pathname = pathname.replace(/\\\\/g, \"/\");\n\n // domain-aware mode\n if (domainAware) {\n if (!isNonEmptyString(domainName)) {\n throw new TypeError(\n \"If parameter `domainAware` is set to `true`, the option parameter `domainName` is required as string, and cant be an empty-string.\"\n );\n }\n\n const cleanDomain = punycodeUtilsJS\n .toASCII(domainName)\n .replace(/^https?:\\/\\//i, \"\")\n .replace(/^www\\./, \"\")\n .replace(/\\/.*$/, \"\")\n .toLowerCase();\n\n const inputDomain = punycodeUtilsJS\n .toASCII(input)\n .replace(/^https?:\\/\\//i, \"\")\n .replace(/^www\\./, \"\")\n .toLowerCase();\n\n const inputHost = inputDomain.split(\"/\")[0]?.split(/[?#]/)[0];\n const matchesDomain =\n inputHost === cleanDomain || inputHost?.endsWith(`.${cleanDomain}`);\n const hasPath = /\\/[^/]+$/.test(inputDomain);\n\n if (matchesDomain && !hasPath) return null;\n }\n\n // handle special protocol-like strings\n const protocolMatch = pathname.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):(.+)$/);\n if (protocolMatch) {\n const scheme = protocolMatch[1]?.toLowerCase() || \"\";\n const rest = protocolMatch[2];\n\n if ([\"tel\", \"sms\"].some((sch) => sch.startsWith(scheme))) {\n const clean = rest?.split(\"?\")[0]?.split(\"#\")[0];\n return clean?.trim() || null;\n } else if (scheme === \"mailto\") {\n const parts = rest?.split(\"/\");\n let last = parts?.[parts.length - 1];\n last = last?.split(\"?\")[0]?.split(\"#\")[0]; // strip query/hash\n const dotIndex = last?.lastIndexOf(\".\");\n if (dotIndex && dotIndex > 0) last = last?.slice(0, dotIndex);\n return last || null;\n } else if (scheme === \"data\") {\n const commaIndex = rest?.indexOf(\",\") || -1;\n if (commaIndex === -1) return null;\n let payload = rest?.slice(commaIndex + 1);\n payload = payload?.split?.(\"?\")[0]?.split(\"#\")[0]; // strip query/hash\n return payload?.trim() || null;\n }\n }\n\n if (/^[a-z][a-z\\d+\\-.]*:\\/{3,}/i.test(pathname)) {\n // eg https:///file.txt (has more than 2 slash after : protocol)\n pathname = pathname.replace(/^[a-z][a-z\\d+\\-.]*:\\/{2,}/i, \"\");\n } else {\n try {\n const isProbablyUrl = /^[a-z][a-z\\d+\\-.]*:(\\/\\/)?/i.test(pathname);\n\n pathname = isProbablyUrl\n ? new URL(pathname).pathname\n : new URL(`http://localhost/${pathname}`).pathname;\n } catch {\n // Fallback for weird URLs like 'https:///file.txt'\n // Remove protocol + any number of slashes\n pathname = pathname.replace(/^[a-z][a-z\\d+\\-.]*:(\\/\\/)?/i, \"\");\n }\n }\n\n // split into non-empty segments\n const segments = pathname.split(\"/\").filter(Boolean);\n\n if (segments.length === 0) return null;\n\n // Take the last segment as candidate filename\n let lastSegment =\n segments[segments.length - 1]?.split(\"?\")[0]?.split(\"#\")[0] || \"\";\n // Strip trailing ? or # that is alone\n lastSegment = lastSegment?.replace(/[?#]+$/, \"\");\n if (!lastSegment) return null;\n\n // Replace encoded slashes and dots\n lastSegment = lastSegment\n .replace(/%2F/gi, \"/\")\n .replace(/%5C/gi, \"\\\\\")\n .replace(/%2E/gi, \".\");\n\n // If replacement introduces new slashes, take the new last segment\n if (lastSegment.includes(\"/\")) {\n const parts = lastSegment.split(\"/\").filter(Boolean);\n lastSegment = parts[parts.length - 1] || \"\";\n }\n\n let filename = decodeURIComponent(lastSegment);\n\n if (!filename) return null;\n\n // Special filenames always returned as-is (even if trailing slash)\n if (SPECIAL_FILENAMES.has(filename)) return filename;\n\n // Dotfiles like \".env\" should be returned as-is (single leading dot, no other dot)\n if (/^\\.[^.\\s][^/]*$/.test(filename)) return filename;\n\n // If the original pathname ends with \"/\" and the last segment doesn't look like a file\n // const originalEndsWithSlash = pathname.endsWith(\"/\");\n if (!filename.includes(\".\")) return null;\n\n // Strip double extensions first\n const sortedDouble = [...DOUBLE_EXTENSIONS_FILE].sort(\n (a, b) => b.length - a.length\n );\n for (const ext of sortedDouble) {\n const dotExt = `.${ext.toLowerCase()}`;\n if (filename.toLowerCase().endsWith(dotExt)) {\n filename = filename.slice(0, filename.length - dotExt.length);\n break;\n }\n }\n\n // Strip single extensions\n const sortedSingle = [...EXTENSIONS_FILE].sort((a, b) => b.length - a.length);\n for (const ext of sortedSingle) {\n const dotExt = `.${ext.toLowerCase()}`;\n if (filename.toLowerCase().endsWith(dotExt)) {\n filename = filename.slice(0, filename.length - dotExt.length);\n break;\n }\n }\n\n return filename || null;\n};\n"],"mappings":";;;;;;;;;;;;;;AAGA,MAAa,kBAAkB,IAAI,IAAI;CAErC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAIA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAKD,MAAa,yBAAyB,IAAI,IAAI;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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AAS,YAAY,EAAE,SAAS,MAAM,GAAG;GAC3C,WAAW,SAAS,MAAM,GAAG,SAAS,SAAS,OAAO,MAAM;GAC5D;EACF;CACF;CAEA,OAAO,YAAY;AACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parsing-BCZGco7n.cjs","names":["isNonEmptyString"],"sources":["../src/conversions/currency/parsing.ts"],"sourcesContent":["import { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** -------------------------------------------------------------\n * * ***Utility: `parseCurrencyString`.***\n * ---------------------------------------------\n * **Parses a human-friendly currency string into a JavaScript number.**\n * - **Supports multi-locale formats:**\n * - ***US:*** `\"15,000.10\"` ➔ `15300.10`.\n * - ***Swiss:*** `\"15'000.10\"` ➔ `15300.10`.\n * - ***French:*** `\"15 000,10\"` ➔ `15300.10`.\n * - ***Indian:*** `\"1,23,456.78\"` ➔ `123456.78`.\n * - ***European:*** `\"151.000,10\"` ➔ `151300.10`.\n * - ***Compact:*** `\"15300000,10\"` ➔ `15300000.10`.\n * - **Features:**\n * - Strips symbols automatically: `\"Rp\"`, `\"$\"`, `\"EUR\"`, `etc`.\n * - Handles bracket negatives: `\"(15.000,10)\"` ➔ `-15300.10`.\n * - Normalizes decimal separator (last dot or comma).\n * - Detects non-breaking spaces (`\\u00A0`, `\\u202F`) often in European data.\n * - Fallback to `0` for empty, invalid, or non-numeric strings.\n * - **How it parses internally:**\n * 1. Removes all characters except digits, `.`, `,`, `'`, `space`,\n * `\\u00A0`, `\\u202F`.\n * 2. Detects bracket (...) as negative.\n * 3. If Indian style (`1,23,456`) detected by multiple ,`\\d{2}`, removes all commas.\n * 4. Otherwise:\n * - If multiple dots & no commas ➔ thousands: removes all `.`.\n * - If multiple commas & no dots ➔ thousands: removes all `,`.\n * - If mixed, treats last `,` or `.` as decimal.\n * 5. Converts final decimal to `.` for JS float.\n * - **Gotchas:**\n * - If both `.` and `,` are present, last occurrence is used as decimal.\n * - For strings like `\"1.121.234,56\"` ➔ decimal is `,`.\n * - For `\"1,121,234.56\"` ➔ decimal is `.`.\n * - For `\"15300000,2121\"` ➔ decimal becomes `.` internally.\n * - **ℹ️ Note:**\n * - You can use this function as a first step to **sanitize currency inputs**\n * before storing into database or doing math.\n * - Always pair this with your formatter for consistent output display.\n * @param {string|null|undefined} input\n * ***Any messy currency string, may contain:***\n * * Currency symbols (`Rp`,`$`, `CHF`, `EUR`).\n * * Thousands separators (`.`, `,`, `'`, `space`, `\\u00A0`, `\\u202F`).\n * * Various decimal formats (`,` or `.`).\n * * Bracket negative: `\"(15.000,10)\"`.\n * @returns {number} JavaScript float representation, will return `0` for invalid, empty, or non-string input.\n * @example\n * ```ts\n * parseCurrencyString(\"Rp 15.300.000,21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"15 300 000,21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"CHF 15'300'000.21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"$15,300,000.21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"(15.000,10)\");\n * // ➔ -15000.10\n * parseCurrencyString(\"1,23,456.78\");\n * // ➔ 123456.78\n * parseCurrencyString(\"15300000,2121\");\n * // ➔ 15300000.2121\n * parseCurrencyString(\"USD 15 300 000.21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"\");\n * // ➔ 0\n * parseCurrencyString(\"abc\");\n * // ➔ 0\n * ```\n */\nexport const parseCurrencyString = (\n input: string | null | undefined\n): number => {\n if (!isNonEmptyString(input)) return 0;\n\n let trimmed = input\n .trim()\n .replace(/\\u00A0/g, \"\")\n .replace(/\\u202F/g, \"\");\n\n // detect brackets (accounting style)\n let isNegative = false;\n if (/^\\(.*\\)$/.test(trimmed)) {\n isNegative = true;\n trimmed = trimmed.slice(1, -1).trim();\n }\n\n trimmed = trimmed\n .replace(/^[-\\s]+/, (match) => (match.includes(\"-\") ? \"-\" : \"\"))\n .replace(/[\\s.,-]+$/, \"\");\n\n isNegative = isNegative || /^-/.test(trimmed) || /^[^\\d]*-/.test(trimmed);\n const cleaned = trimmed.replace(/[^0-9.,'\\s]/g, \"\");\n let cleanedNoSpace = cleaned.replace(/[\\s']/g, \"\");\n\n // detect Indian style (like 1,23,456)\n const indianMatches = cleanedNoSpace.match(/,\\d{2}/g);\n const isIndianStyle = indianMatches && indianMatches.length > 1;\n if (isIndianStyle) {\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else {\n const dotCount = (cleanedNoSpace.match(/\\./g) || []).length;\n const commaCount = (cleanedNoSpace.match(/,/g) || []).length;\n\n if (dotCount > 1 && commaCount === 0) {\n // e.g. \"1.121.234\"\n cleanedNoSpace = cleanedNoSpace.replace(/\\./g, \"\");\n } else if (commaCount > 1 && dotCount === 0) {\n // e.g. \"1,121,234\"\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else {\n // mixed, or single\n const lastComma = cleanedNoSpace.lastIndexOf(\",\");\n const lastDot = cleanedNoSpace.lastIndexOf(\".\");\n\n if (lastComma > lastDot) {\n // comma likely decimal\n cleanedNoSpace = cleanedNoSpace.replace(/\\./g, \"\").replace(\",\", \".\");\n } else if (lastDot > lastComma) {\n // dot likely decimal\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else {\n if (lastComma > lastDot) {\n // comma is likely decimal\n const beforeDecimal = cleanedNoSpace\n .slice(0, lastComma)\n .replace(/,/g, \"\")\n .replace(/\\./g, \"\");\n const afterDecimal = cleanedNoSpace.slice(lastComma + 1);\n cleanedNoSpace = beforeDecimal + \".\" + afterDecimal;\n } else if (lastDot > lastComma) {\n // dot is likely decimal\n const beforeDecimal = cleanedNoSpace\n .slice(0, lastDot)\n .replace(/\\./g, \"\")\n .replace(/,/g, \"\");\n const afterDecimal = cleanedNoSpace.slice(lastDot + 1);\n cleanedNoSpace = beforeDecimal + \".\" + afterDecimal;\n } else if (lastComma !== -1) {\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else if (lastDot !== -1)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E,QAAQ,KAAK,GAAG;QAC9D,IAAI,UAAU,WAEnB,iBAAiB,eAAe,QAAQ,MAAM,EAAE;QAEhD,IAAI,YAAY,SAAS;IAEvB,MAAM,gBAAgB,eACnB,MAAM,GAAG,SAAS,EAClB,QAAQ,MAAM,EAAE,EAChB,QAAQ,OAAO,EAAE;IACpB,MAAM,eAAe,eAAe,MAAM,YAAY,CAAC;IACvD,iBAAiB,gBAAgB,MAAM;GACzC,OAAO,IAAI,UAAU,WAAW;IAE9B,MAAM,gBAAgB,eACnB,MAAM,GAAG,OAAO,EAChB,QAAQ,OAAO,EAAE,EACjB,QAAQ,MAAM,EAAE;IACnB,MAAM,eAAe,eAAe,MAAM,UAAU,CAAC;IACrD,iBAAiB,gBAAgB,MAAM;GACzC,OAAO,IAAI,cAAc,IACvB,iBAAiB,eAAe,QAAQ,MAAM,EAAE;QAC3C,IAAI,YAAY,IACrB,iBAAiB,eAAe,QAAQ,OAAO,EAAE;EAGvD;CACF;CAEA,MAAM,MAAM,WAAW,cAAc,KAAK;CAC1C,OAAO,aAAa,CAAC,MAAM;AAC7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parsing-Bfaw85Hd.js","names":[],"sources":["../src/conversions/currency/parsing.ts"],"sourcesContent":["import { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** -------------------------------------------------------------\n * * ***Utility: `parseCurrencyString`.***\n * ---------------------------------------------\n * **Parses a human-friendly currency string into a JavaScript number.**\n * - **Supports multi-locale formats:**\n * - ***US:*** `\"15,000.10\"` ➔ `15300.10`.\n * - ***Swiss:*** `\"15'000.10\"` ➔ `15300.10`.\n * - ***French:*** `\"15 000,10\"` ➔ `15300.10`.\n * - ***Indian:*** `\"1,23,456.78\"` ➔ `123456.78`.\n * - ***European:*** `\"151.000,10\"` ➔ `151300.10`.\n * - ***Compact:*** `\"15300000,10\"` ➔ `15300000.10`.\n * - **Features:**\n * - Strips symbols automatically: `\"Rp\"`, `\"$\"`, `\"EUR\"`, `etc`.\n * - Handles bracket negatives: `\"(15.000,10)\"` ➔ `-15300.10`.\n * - Normalizes decimal separator (last dot or comma).\n * - Detects non-breaking spaces (`\\u00A0`, `\\u202F`) often in European data.\n * - Fallback to `0` for empty, invalid, or non-numeric strings.\n * - **How it parses internally:**\n * 1. Removes all characters except digits, `.`, `,`, `'`, `space`,\n * `\\u00A0`, `\\u202F`.\n * 2. Detects bracket (...) as negative.\n * 3. If Indian style (`1,23,456`) detected by multiple ,`\\d{2}`, removes all commas.\n * 4. Otherwise:\n * - If multiple dots & no commas ➔ thousands: removes all `.`.\n * - If multiple commas & no dots ➔ thousands: removes all `,`.\n * - If mixed, treats last `,` or `.` as decimal.\n * 5. Converts final decimal to `.` for JS float.\n * - **Gotchas:**\n * - If both `.` and `,` are present, last occurrence is used as decimal.\n * - For strings like `\"1.121.234,56\"` ➔ decimal is `,`.\n * - For `\"1,121,234.56\"` ➔ decimal is `.`.\n * - For `\"15300000,2121\"` ➔ decimal becomes `.` internally.\n * - **ℹ️ Note:**\n * - You can use this function as a first step to **sanitize currency inputs**\n * before storing into database or doing math.\n * - Always pair this with your formatter for consistent output display.\n * @param {string|null|undefined} input\n * ***Any messy currency string, may contain:***\n * * Currency symbols (`Rp`,`$`, `CHF`, `EUR`).\n * * Thousands separators (`.`, `,`, `'`, `space`, `\\u00A0`, `\\u202F`).\n * * Various decimal formats (`,` or `.`).\n * * Bracket negative: `\"(15.000,10)\"`.\n * @returns {number} JavaScript float representation, will return `0` for invalid, empty, or non-string input.\n * @example\n * ```ts\n * parseCurrencyString(\"Rp 15.300.000,21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"15 300 000,21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"CHF 15'300'000.21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"$15,300,000.21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"(15.000,10)\");\n * // ➔ -15000.10\n * parseCurrencyString(\"1,23,456.78\");\n * // ➔ 123456.78\n * parseCurrencyString(\"15300000,2121\");\n * // ➔ 15300000.2121\n * parseCurrencyString(\"USD 15 300 000.21\");\n * // ➔ 15300000.21\n * parseCurrencyString(\"\");\n * // ➔ 0\n * parseCurrencyString(\"abc\");\n * // ➔ 0\n * ```\n */\nexport const parseCurrencyString = (\n input: string | null | undefined\n): number => {\n if (!isNonEmptyString(input)) return 0;\n\n let trimmed = input\n .trim()\n .replace(/\\u00A0/g, \"\")\n .replace(/\\u202F/g, \"\");\n\n // detect brackets (accounting style)\n let isNegative = false;\n if (/^\\(.*\\)$/.test(trimmed)) {\n isNegative = true;\n trimmed = trimmed.slice(1, -1).trim();\n }\n\n trimmed = trimmed\n .replace(/^[-\\s]+/, (match) => (match.includes(\"-\") ? \"-\" : \"\"))\n .replace(/[\\s.,-]+$/, \"\");\n\n isNegative = isNegative || /^-/.test(trimmed) || /^[^\\d]*-/.test(trimmed);\n const cleaned = trimmed.replace(/[^0-9.,'\\s]/g, \"\");\n let cleanedNoSpace = cleaned.replace(/[\\s']/g, \"\");\n\n // detect Indian style (like 1,23,456)\n const indianMatches = cleanedNoSpace.match(/,\\d{2}/g);\n const isIndianStyle = indianMatches && indianMatches.length > 1;\n if (isIndianStyle) {\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else {\n const dotCount = (cleanedNoSpace.match(/\\./g) || []).length;\n const commaCount = (cleanedNoSpace.match(/,/g) || []).length;\n\n if (dotCount > 1 && commaCount === 0) {\n // e.g. \"1.121.234\"\n cleanedNoSpace = cleanedNoSpace.replace(/\\./g, \"\");\n } else if (commaCount > 1 && dotCount === 0) {\n // e.g. \"1,121,234\"\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else {\n // mixed, or single\n const lastComma = cleanedNoSpace.lastIndexOf(\",\");\n const lastDot = cleanedNoSpace.lastIndexOf(\".\");\n\n if (lastComma > lastDot) {\n // comma likely decimal\n cleanedNoSpace = cleanedNoSpace.replace(/\\./g, \"\").replace(\",\", \".\");\n } else if (lastDot > lastComma) {\n // dot likely decimal\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else {\n if (lastComma > lastDot) {\n // comma is likely decimal\n const beforeDecimal = cleanedNoSpace\n .slice(0, lastComma)\n .replace(/,/g, \"\")\n .replace(/\\./g, \"\");\n const afterDecimal = cleanedNoSpace.slice(lastComma + 1);\n cleanedNoSpace = beforeDecimal + \".\" + afterDecimal;\n } else if (lastDot > lastComma) {\n // dot is likely decimal\n const beforeDecimal = cleanedNoSpace\n .slice(0, lastDot)\n .replace(/\\./g, \"\")\n .replace(/,/g, \"\");\n const afterDecimal = cleanedNoSpace.slice(lastDot + 1);\n cleanedNoSpace = beforeDecimal + \".\" + afterDecimal;\n } else if (lastComma !== -1) {\n cleanedNoSpace = cleanedNoSpace.replace(/,/g, \"\");\n } else if (lastDot !== -1) {\n cleanedNoSpace = cleanedNoSpace.replace(/\\./g, \"\");\n }\n }\n }\n }\n\n const num = parseFloat(cleanedNoSpace) || 0;\n return isNegative ? -num : num;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAa,uBACX,UACW;CACX,IAAI,CAAC,iBAAiB,KAAK,GAAG,OAAO;CAErC,IAAI,UAAU,MACX,KAAK,EACL,QAAQ,WAAW,EAAE,EACrB,QAAQ,WAAW,EAAE;CAGxB,IAAI,aAAa;CACjB,IAAI,WAAW,KAAK,OAAO,GAAG;EAC5B,aAAa;EACb,UAAU,QAAQ,MAAM,GAAG,EAAE,EAAE,KAAK;CACtC;CAEA,UAAU,QACP,QAAQ,YAAY,UAAW,MAAM,SAAS,GAAG,IAAI,MAAM,EAAG,EAC9D,QAAQ,aAAa,EAAE;CAE1B,aAAa,cAAc,KAAK,KAAK,OAAO,KAAK,WAAW,KAAK,OAAO;CAExE,IAAI,iBADY,QAAQ,QAAQ,gBAAgB,EACrB,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1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"predicates-8y28VrbT.cjs","names":["isArray","getPreciseType","isEqual","safeStableStringify","isEqual","isURL","isURL","isNonEmptyString","isArray","isNonEmptyString","isArray","isObjectOrArray","getPreciseType","isArray","isArray","isEmptyArray","isFunction","isObjectOrArray","isObjectOrArray","isString","isNumber","parseCurrencyString","isDate","isRegExp","isSymbol","isSet","isMap","isArray","isObjectOrArray","isPlainObject","isNil","isBoolean","isNumber","isSymbol","isFunction","isString","isArray","isTypedArray","isMap","isSet","isBuffer","isPlainObject","isString","isEmptyString","isNumber","isNaN","isArray","isEmptyArray","isObjectOrArray","baseDeepEqual","isObjectOrArray","isArray","isUndefined","isFunction","isNil","isObjectOrArray","isFunction","isNonEmptyString","isObject","isNull"],"sources":["../src/predicates/are/areArraysEqual.ts","../src/predicates/are/areObjectsEqual.ts","../src/predicates/are/areURLsEqualPath.ts","../src/predicates/are/areURLsIdentical.ts","../src/predicates/contains/textContainsAll.ts","../src/predicates/contains/textContainsAny.ts","../src/predicates/is/isPropertyKey.ts","../src/predicates/exist/doesKeyExist.ts","../src/predicates/has/arrayHasAnyMatch.ts","../src/predicates/is/isArgument.ts","../src/predicates/is/isLength.ts","../src/predicates/is/isArrayLike.ts","../src/predicates/is/isArrayLikeObject.ts","../src/predicates/is/isCurrencyLike.ts","../src/predicates/is/isDeepEqual.ts","../src/predicates/is/isElement.ts","../src/predicates/is/isEmpty.ts","../src/predicates/is/isEmptyDeep.ts","../src/predicates/is/isEqualWith.ts","../src/predicates/is/isMatchWith.ts","../src/predicates/is/_private/baseIsMatch.ts","../src/predicates/is/isMatch.ts","../src/predicates/is/isNative.ts","../src/predicates/is/isObjectLoose.ts","../src/predicates/is/isSafeInteger.ts","../src/predicates/is/isValidURL.ts","../src/predicates/is/isWeakMap.ts"],"sourcesContent":["import { isArray } from \"../is/isArray\";\nimport { isEqual } from \"../is/isEqual\";\nimport { getPreciseType } from \"../type/getPreciseType\";\n\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** ----------------------------------------------------------\n * * ***Predicate: `areArraysEqual`.***\n * ----------------------------------------------------------\n * **Compares two arrays deeply to check if they are equal.**\n * @description Supports deep comparison of arrays containing nested arrays or objects,\n * can also ignore the order of elements at all levels by recursively sorting.\n * @param {unknown[]} array1\n * ***The first array to compare, can contain nested arrays or objects.***\n * @param {unknown[]} array2\n * ***The second array to compare against, should match structure of `array1`.***\n * @param {boolean|undefined} [ignoreOrder=false]\n * ***Whether to ignore the order of elements when comparing.***\n * - If `true`, will sort both arrays recursively before comparing, default is `false`.\n * @returns {boolean}\n * Returns `true` if both arrays are deeply equal, otherwise `false`.\n * @throws **{@link TypeError | `TypeError`}** if `array1` or `array2` are not arrays, or if `ignoreOrder` is not a boolean.\n * @example\n * ```ts\n * areArraysEqual([1, 2, 3], [1, 2, 3]);\n * // ➔ true\n * areArraysEqual([1, 2, 3], [3, 2, 1]);\n * // ➔ false\n * areArraysEqual([1, 2, 3], [3, 2, 1], true);\n * // ➔ true (order ignored)\n * areArraysEqual([{ x: 1 }, { y: 2 }], [{ y: 2 }, { x: 1 }], true);\n * // ➔ true\n * ```\n */\nexport const areArraysEqual = (\n array1: unknown[],\n array2: unknown[],\n ignoreOrder: boolean = false\n): boolean => {\n if (!(isArray(array1) && isArray(array2))) {\n throw new TypeError(\n `Parameters \\`array1\\` and \\`array2\\` property of the \\`options\\` (second parameter) must be of type \\`array\\`, but received: ['array1': \\`${getPreciseType(\n array1\n )}\\`, 'array2': \\`${getPreciseType(array2)}\\`].`\n );\n }\n\n assertIsBoolean(ignoreOrder, {\n message: ({ currentType, validType }) =>\n `Third parameter \\`ignoreOrder\\` must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (!isEqual(array1.length, array2.length)) return false;\n\n /**\n * Recursively sorts an array (and nested arrays) so that\n * deep equality checks can ignore order at all levels.\n *\n * @param {unknown[]} arr - The array to deep sort.\n * @returns {unknown[]} A new deeply sorted array.\n */\n const deepIgnoreOrder = (arr: unknown[]): unknown[] => {\n if (!isArray(arr)) return arr;\n\n // Recursively sort nested arrays\n const sorted = arr.map((item) => {\n if (isArray(item)) {\n return deepIgnoreOrder(item);\n }\n return item;\n });\n\n // Sort current array level\n return sorted.sort((a, b) => {\n const sa = safeStableStringify(a);\n const sb = safeStableStringify(b);\n return sa < sb ? -1 : sa > sb ? 1 : 0;\n });\n };\n\n const normalizedArr1 = ignoreOrder ? deepIgnoreOrder(array1) : array1;\n const normalizedArr2 = ignoreOrder ? deepIgnoreOrder(array2) : array2;\n\n if (!isEqual(normalizedArr1.length, normalizedArr2.length)) return false;\n\n return normalizedArr1.every(\n (item, index) =>\n safeStableStringify(item) === safeStableStringify(normalizedArr2[index])\n );\n};\n","import { isEqual } from \"../is/isEqual\";\n\n/** ---------------------------------\n * * ***Predicate: `areObjectsEqual`.***\n * ---------------------------------\n * **Compares two objects for deep equality.**\n * @template T1 The type of the first object.\n * @template T2 The type of the second object.\n * @param {*} object1 - The first object to compare.\n * @param {*} object2 - The second object to compare.\n * @returns {boolean} Return `true` if both objects are deeply equal, otherwise `false`.\n * @example\n * areObjectsEqual({ a: 1, b: 2 }, { a: 1, b: 2 });\n * // ➔ true\n * areObjectsEqual({ a: 1 }, { a: 1, b: undefined });\n * // ➔ false\n * areObjectsEqual([1, 2, 3], [1, 2, 3]);\n * // ➔ true\n */\nexport const areObjectsEqual = (\n object1: unknown,\n object2: unknown\n): boolean => {\n return isEqual(object1, object2);\n};\n","import { isURL } from \"../is/isURL\";\n\n/** ---------------------------------\n * * ***Predicate: `areURLsEqualPath`.***\n * ---------------------------------\n * **Checks if two URLs are the same, ignoring query parameters, this function compares only the protocol, host, and pathname.**\n * @param {URL} urlA - The first URL to compare.\n * @param {URL} urlB - The second URL to compare.\n * @returns {boolean} Returns `true` if both URLs are the same (ignoring search parameters), otherwise `false`.\n * @example\n * // Same domain, same path, different query -> true\n * areURLsEqualPath(\n * new URL(\"https://example.com/page?a=1\"),\n * new URL(\"https://example.com/page?b=2\")\n * );\n * // ➔ true\n *\n * // Same domain, different path -> false\n * areURLsEqualPath(\n * new URL(\"https://example.com/page1\"),\n * new URL(\"https://example.com/page2\")\n * );\n * // ➔ false\n *\n * // Different protocol -> false\n * areURLsEqualPath(\n * new URL(\"http://example.com/page\"),\n * new URL(\"https://example.com/page\")\n * );\n * // ➔ false\n *\n * // Same protocol, same host, same path (ignores query & hash) -> true\n * areURLsEqualPath(\n * new URL(\"https://example.com/page#section\"),\n * new URL(\"https://example.com/page\")\n * );\n * // ➔ true\n */\nexport const areURLsEqualPath = (urlA: URL, urlB: URL): boolean => {\n if (!isURL(urlA) || !isURL(urlB)) {\n throw new TypeError(\n \"Parameters `urlA` and `urlB` (first and second parameter) must be instance of URL.\"\n );\n }\n\n return (\n urlA.protocol + \"//\" + urlA.host + urlA.pathname ===\n urlB.protocol + \"//\" + urlB.host + urlB.pathname\n );\n};\n","import { isURL } from \"../is/isURL\";\n\n/** ---------------------------------\n * * ***Predicate: `areURLsIdentical`.***\n * ---------------------------------\n * **Checks if two URLs are exactly the same, including protocol, host, pathname, and query parameters.**\n * @param {URL} urlA - The first URL to compare.\n * @param {URL} urlB - The second URL to compare.\n * @returns {boolean} Returns `true` if both URLs are identical, otherwise `false`.\n * @example\n * // Identical URLs -> true\n * areURLsIdentical(\n * new URL(\"https://example.com/page?a=1\"),\n * new URL(\"https://example.com/page?a=1\")\n * );\n * // ➔ true\n *\n * // Same path, different query parameter -> false\n * areURLsIdentical(\n * new URL(\"https://example.com/page?a=1\"),\n * new URL(\"https://example.com/page?b=2\")\n * );\n * // ➔ false\n *\n * // Same host & query, but different protocol -> false\n * areURLsIdentical(\n * new URL(\"http://example.com/page?a=1\"),\n * new URL(\"https://example.com/page?a=1\")\n * );\n * // ➔ false\n *\n * // Same everything except trailing slash -> false\n * areURLsIdentical(\n * new URL(\"https://example.com/page\"),\n * new URL(\"https://example.com/page/\")\n * );\n * // ➔ false\n */\nexport const areURLsIdentical = (urlA: URL, urlB: URL): boolean => {\n if (!isURL(urlA) || !isURL(urlB)) {\n throw new TypeError(\n \"Parameters `urlA` and `urlB` (first and second parameter) must be instance of URL.\"\n );\n }\n\n return (\n urlA.protocol + \"//\" + urlA.host + urlA.pathname + urlA.search ===\n urlB.protocol + \"//\" + urlB.host + urlB.pathname + urlB.search\n );\n};\n","import { isArray } from \"../is/isArray\";\nimport { isNonEmptyString } from \"../is/isNonEmptyString\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\ntype OptionsTextContainsAll = {\n /** If `true`, matches whole words only, defaultValue is `false`.\n *\n * @default false\n */\n exactMatch?: boolean;\n /** Optional regex flags (default: `\"i\"` for case-insensitive).\n *\n * @default \"i\"\n */\n flags?: string;\n};\n\n/** ----------------------------------------------------------\n * * ***Predicate: `textContainsAll`.***\n * ----------------------------------------------------------\n * **Checks if the given `text` contains all of the specified `searchWords`.**\n * - **Behavior:**\n * - Returns `false` if `text` or `searchWords` is `null`/`undefined`/invalid.\n * - Uses **regular expressions** for flexible pattern matching.\n * - **Escapes special characters** to prevent regex injection attacks.\n * - **Trims input** to avoid false positives with empty spaces.\n * - **Supports exact word matching** (optional).\n * @param {string|null|undefined} text - The string text to search within.\n * @param {string[]|null} [searchWords] - An array of words/phrases to match against the text.\n * @param {OptionsTextContainsAll} [options] - Optional configuration object.\n * @param {OptionsTextContainsAll[\"exactMatch\"]} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.\n * @param {OptionsTextContainsAll[\"flags\"]} [options.flags=\"i\"] - Optional regex flags (default: `\"i\"` for case-insensitive).\n * @returns {boolean} Return `true` if all `searchWords` are found in `text`, otherwise `false`.\n * @example\n * textContainsAll(\"Hello world, WithAI APP\", [\"Hello\", \"world\"]);\n * // ➔ true\n * textContainsAll(\"JavaScript and TypeScript\", [\"Java\", \"Script\"]);\n * // ➔ true\n * textContainsAll(\"Machine Learning\", [\"AI\", \"Learning\"]);\n * // ➔ false\n * textContainsAll(\"open-source\", [\"open\"], { exactMatch: true });\n * // ➔ false (because options `exactMatch=true`)\n * textContainsAll(null, [\"test\"]);\n * // ➔ false (invalid text)\n * textContainsAll(\"Hello\", null);\n * // ➔ false (invalid searchWords)\n */\nexport const textContainsAll = <T extends string>(\n text?: T | null,\n searchWords?: T[] | string[] | null,\n options: OptionsTextContainsAll = {}\n): boolean => {\n if (!isNonEmptyString(text) || !isArray(searchWords)) {\n return false;\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Third parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n // fallback to default\n const { exactMatch = false, flags = \"i\" } = options;\n\n assertIsBoolean(exactMatch, {\n message: ({ currentType, validType }) =>\n `Parameter \\`exactMatch\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsString(flags, {\n message: ({ currentType, validType }) =>\n `Parameter \\`flags\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n // Escape special regex characters to prevent unintended behavior\n const escapeRegex = (str: string) =>\n str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n // Filter out empty search words\n const validSearchWords = searchWords\n .filter((word) => isNonEmptyString(word))\n .map(escapeRegex);\n\n if (validSearchWords.length === 0) return false;\n\n // Create regex pattern: Whole word match (`\\bword\\b`) <- is deprecated. if `exactMatch` is true\n return validSearchWords.every((word) => {\n const pattern = exactMatch ? `(?<!\\\\S)${word}(?!\\\\S)` : word;\n return new RegExp(pattern, flags.includes(\"u\") ? flags : flags + \"u\").test(\n text\n );\n });\n};\n","import { isArray } from \"../is/isArray\";\nimport { isNonEmptyString } from \"../is/isNonEmptyString\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\ntype OptionsTextContainsAny = {\n /** If `true`, matches whole words only, defaultValue is `false`.\n *\n * @default false\n */\n exactMatch?: boolean;\n /** Optional regex flags (default: `\"i\"` for case-insensitive).\n *\n * @default \"i\"\n */\n flags?: string;\n};\n\n/** ----------------------------------------------------------\n * * ***Predicate: `textContainsAny`.***\n * ----------------------------------------------------------\n * **Checks if the given `text` contains at least one of the specified `searchWords`.**\n * - **Behavior:**\n * - Returns `false` if `text` or `searchWords` is `null`/`undefined`/invalid.\n * - Uses **regular expressions** for flexible pattern matching.\n * - **Escapes special characters** to prevent regex injection attacks.\n * - **Trims input** to avoid false positives with empty spaces.\n * - **Supports exact word matching** (optional).\n * @param {string|null|undefined} text - The string text to search within.\n * @param {string[]|null} [searchWords] - An array of words/phrases to match against the text.\n * @param {OptionsTextContainsAny} [options] - Optional configuration object.\n * @param {OptionsTextContainsAny[\"exactMatch\"]} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.\n * @param {OptionsTextContainsAny[\"flags\"]} [options.flags=\"i\"] - Optional regex flags (default: `\"i\"` for case-insensitive).\n * @returns {boolean} Return `true` if at least one `searchWord` is found in `text`, otherwise `false`.\n * @example\n * textContainsAny(\"Hello world\", [\"hello\", \"test\"]);\n * // ➔ true\n * textContainsAny(\"withAI APP\", [\"chat\", \"ai\"]);\n * // ➔ false\n * textContainsAny(\"TypeScript is great!\", [\"script\", \"java\"]);\n * // ➔ true\n * textContainsAny(\"open-source\", [\"open\"], { exactMatch: true });\n * // ➔ false (because options `exactMatch=true`)\n * textContainsAny(null, [\"test\"]);\n * // ➔ false (invalid text)\n * textContainsAny(\"Hello\", null);\n * // ➔ false (invalid searchWords)\n */\nexport const textContainsAny = <T extends string>(\n text?: T | null,\n searchWords?: T[] | string[] | null,\n options: OptionsTextContainsAny = {}\n): boolean => {\n if (!isNonEmptyString(text) || !isArray(searchWords)) {\n return false;\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Third parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n // fallback to default\n const { exactMatch = false, flags = \"i\" } = options;\n\n assertIsBoolean(exactMatch, {\n message: ({ currentType, validType }) =>\n `Parameter \\`exactMatch\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsString(flags, {\n message: ({ currentType, validType }) =>\n `Parameter \\`flags\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n // Escape special regex characters to prevent unintended behavior\n const escapeRegex = (str: string) =>\n str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n // Filter out empty search words\n const validSearchWords = searchWords\n .filter((word) => isNonEmptyString(word))\n .map(escapeRegex);\n\n if (validSearchWords.length === 0) return false;\n\n const pattern = exactMatch\n ? `(?<!\\\\S)(${validSearchWords.join(\"|\")})(?!\\\\S)`\n : `(${validSearchWords.join(\"|\")})`;\n\n return new RegExp(pattern, flags.includes(\"u\") ? flags : flags + \"u\").test(\n text\n );\n};\n","/** ----------------------------------------------------------\n * * ***Type guard: `PropertyKey`.***\n * ----------------------------------------------------------\n * **Checks if a value is a valid `PropertyKey`.**\n * - **In JavaScript/TypeScript, a **`PropertyKey`** is any of:**\n * - **`string`**\n * - **`number`**\n * - **`symbol`**\n * - **This function ensures the given `value` is one of these types.**\n * - Narrows type to {@link PropertyKey | ***`PropertyKey`***} when true.\n * - Useful for working with dynamic object keys.\n * - Strictly rejects `null`, `undefined`, `boolean`, `object`, `function`, etc.\n * @param {*} value - The value to check.\n * @returns {boolean} Return `true` if `value` is a valid property key, otherwise `false`.\n * @example\n * isPropertyKey(\"foo\");\n * // ➔ true\n * isPropertyKey(123);\n * // ➔ true\n * isPropertyKey(Symbol(\"id\"));\n * // ➔ true\n * isPropertyKey({});\n * // ➔ false\n * isPropertyKey(null);\n * // ➔ false\n */\nexport function isPropertyKey(value: unknown): value is PropertyKey {\n const type = typeof value;\n return type === \"string\" || type === \"number\" || type === \"symbol\";\n}\n","import { isArray } from \"../is/isArray\";\nimport { isPropertyKey } from \"../is/isPropertyKey\";\nimport { isObjectOrArray } from \"../is/isObjectOrArray\";\nimport { getPreciseType } from \"../type/getPreciseType\";\n\n/** ----------------------------------------------------------\n * * ***Predicate: `doesKeyExist`.***\n * ----------------------------------------------------------\n * **Recursively checks if a given key exists in an object or array.**\n * - **Behavior:**\n * - **Supports deeply nested objects and arrays**, searching recursively.\n * - Uses `Object.prototype.hasOwnProperty.call()` to safely check if the\n * key exists at each level, even if its value is `null` or `undefined`.\n * - Optimized to return `true` immediately when the key is found (short-circuits).\n * - Handles edge cases gracefully:\n * - Returns `false` for `null`, `undefined`, or non-object inputs.\n * - Returns `false` if key is not found anywhere, even in deeply nested\n * structures.\n * - **ℹ️ Note:**\n * - This function only checks for **the existence of the key itself**,\n * not whether its value is non-null or non-undefined.\n * - If you need to check for both existence and meaningful value, write a stricter function.\n * @template T - The type of the input object or array.\n * @param {T | Record<string, unknown> | unknown[]} object - The object or array to search.\n * @param {PropertyKey} key - The key to look for (string, number, or symbol).\n * @returns {boolean} Returns `true` if the key exists anywhere in the object or array (even with `null` / `undefined` value), otherwise `false`.\n * @example\n * doesKeyExist({ name: \"John\", age: 30 }, \"age\");\n * // ➔ true\n * doesKeyExist({ user: { profile: { email: \"test@example.com\" } } }, \"email\");\n * // ➔ true\n * doesKeyExist([{ id: 1 }, { id: 2 }], \"id\");\n * // ➔ true\n * doesKeyExist({ a: { b: { c: 10 } } }, \"d\");\n * // ➔ false\n * doesKeyExist(null, \"name\");\n * // ➔ false\n * doesKeyExist(undefined, \"test\");\n * // ➔ false\n *\n * // Key exists even if value is null or undefined:\n * doesKeyExist({ a: null, b: undefined, c: { d: null } }, \"a\"); // ➔ true\n * doesKeyExist({ a: null, b: undefined, c: { d: null } }, \"b\"); // ➔ true\n * doesKeyExist({ a: null, b: undefined, c: { d: null } }, \"d\"); // ➔ true\n *\n * doesKeyExist({ a: 1 }, true);\n * // ➔ ❌ Throws TypeError\n * doesKeyExist({ a: 1 }, [\"not\", \"valid\"]);\n * // ➔ ❌ Throws TypeError\n */\nexport const doesKeyExist = (\n object: Record<string, unknown> | unknown[],\n key: PropertyKey\n): boolean => {\n if (!isObjectOrArray(object)) return false; // Handle null, undefined, and non-objects\n\n if (!isPropertyKey(key)) {\n throw new TypeError(\n `Second Parameter (\\`key\\`) must be of type \\`string\\`, \\`number\\` or \\`symbol\\`, but received: \\`${getPreciseType(\n key\n )}\\`.`\n );\n }\n\n // Direct match found\n if (Object.prototype.hasOwnProperty.call(object, key)) return true;\n\n if (isArray(object)) {\n // Check each array item recursively\n return object.some((item) => doesKeyExist(item as unknown[], key));\n }\n\n return Object.values(object).some(\n (value) => isObjectOrArray(value) && doesKeyExist(value, key)\n );\n};\n","import { isArray } from \"../is/isArray\";\nimport { isEmptyArray } from \"../is/isEmptyArray\";\n\n/** ----------------------------------------------------------\n * * ***Predicate: `arrayHasAnyMatch`.***\n * ----------------------------------------------------------\n * **Checks if at least one element from `targetArray` exists in `sourceArray`.**\n * - **Behavior:**\n * - Uses `Set` for **faster lookup** compared to `Array.prototype.includes()`.\n * - Supports **any data type** (`number`, `string`, `boolean`, `object`, `array`, `function`, etc.).\n * - Uses **reference equality** for non-primitive values (object, array, function).\n * - Returns `false` if either array is missing, empty, or not an array.\n * @template T - The expected type of array elements.\n * @param {T[] | null | undefined} sourceArray - The array to search within.\n * @param {T[] | null | undefined} targetArray - The array containing elements to match.\n * @returns {boolean}\n * ***Return:***\n * - `true` if **at least one element from `targetArray` is strictly found\n * in `sourceArray`**.\n * - Comparison uses:\n * - **Value equality** for primitives (`number`, `string`, `boolean`, `null`, `undefined`).\n * - **Reference equality** for `objects`, `arrays`, and `functions`.\n * - `false` if:\n * - No matching elements exist,\n * - Either array is not provided, not an actual array, or is empty.\n * @example\n * arrayHasAnyMatch([\"apple\", \"banana\", \"cherry\"], [\"banana\", \"grape\"]);\n * // ➔ true\n * arrayHasAnyMatch([\"red\", \"blue\"], [\"green\", \"yellow\"]);\n * // ➔ false\n * arrayHasAnyMatch([1, 2, 3], [3, 4, 5]);\n * // ➔ true\n * arrayHasAnyMatch([], [\"test\"]);\n * // ➔ false\n * arrayHasAnyMatch([\"A\", \"B\", \"C\"], []);\n * // ➔ false\n *\n * const obj = { x: 1 };\n * arrayHasAnyMatch([obj], [obj]);\n * // ➔ true (same reference)\n * arrayHasAnyMatch([{ x: 1 }], [{ x: 1 }]);\n * // ➔ false (different reference)\n *\n * const fn = () => \"hello\";\n * arrayHasAnyMatch([fn], [fn]);\n * // ➔ true\n * arrayHasAnyMatch([() => \"hello\"], [() => \"hello\"]);\n * // ➔ false (different function reference)\n *\n * const arr = [1, 2];\n * arrayHasAnyMatch([arr], [arr]);\n * // ➔ true\n * arrayHasAnyMatch([[1, 2]], [[1, 2]]);\n * // ➔ false (different array object)\n */\nexport const arrayHasAnyMatch = <T>(\n sourceArray: T[] | null | undefined,\n targetArray: T[] | null | undefined\n): boolean => {\n if (\n !isArray(sourceArray) ||\n !isArray(targetArray) ||\n isEmptyArray(sourceArray) ||\n isEmptyArray(targetArray)\n ) {\n return false;\n }\n\n // use Set for lookup more faster.\n const sourceSet = new Set(sourceArray);\n return targetArray.some((item) => sourceSet.has(item));\n};\n","/** -------------------\n * * ***Type guard: `isArguments`.***\n * -------------------\n * **Checks if `value` is likely an `arguments` object.**\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an ***[`IArguments`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments)*** object, else `false`.\n * @example\n * isArguments(function() { return arguments; }());\n * // ➔ true\n * isArguments([1, 2, 3]);\n * // ➔ false\n */\nexport const isArguments = (value: unknown): value is IArguments => {\n return Object.prototype.toString.call(value) === \"[object Arguments]\";\n};\n","/** ----------------------------------------\n * * ***Predicate: `isLength`.***\n * ----------------------------------------------------------\n * **Checks whether the given value is a **valid array-like length**.**\n * - **Behavior:**\n * - ✅ Ensures the value is a **non-negative integer**.\n * - ✅ Ensures the value is **not greater than `Number.MAX_SAFE_INTEGER`**.\n * - ❌ Excludes non-numeric values, `Infinity`, and fractional numbers.\n * - **ℹ️ Note:**\n * - This method is loosely based-on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n * - A valid length must be a non-negative integer and **not greater\n * than `Number.MAX_SAFE_INTEGER`**.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n * isLength(3);\n * // ➔ true\n * isLength(Number.MAX_SAFE_INTEGER);\n * // ➔ true\n * isLength(Number.MAX_SAFE_INTEGER + 1);\n * // ➔ false\n * isLength(\"3\");\n * // ➔ false\n * isLength(-1);\n * // ➔ false\n * isLength(3.14);\n * // ➔ false\n * isLength(Infinity);\n * // ➔ false\n * isLength(-Infinity);\n * // ➔ false\n * isLength(Number.MIN_VALUE);\n * // ➔ false\n */\nexport function isLength(value: unknown): boolean {\n return (\n typeof value === \"number\" &&\n value > -1 &&\n Number.isInteger(value) &&\n value <= Number.MAX_SAFE_INTEGER\n );\n}\n","import type { AnyFunction } from \"@rzl-zone/ts-types-plus\";\n\nimport { isLength } from \"./isLength\";\nimport { isFunction } from \"./isFunction\";\nimport { isObjectOrArray } from \"./isObjectOrArray\";\n\n/** ----------------------------------------------------\n * * ***Type guard: `isArrayLike`.***\n * ----------------------------------------------------\n * **Checks if `value` is array-like, a value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.**\n * @template T - The type of the value being checked.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n * isArrayLike([1, 2, 3]);\n * // ➔ true\n * isArrayLike(document.body.children);\n * // ➔ true\n * isArrayLike(noop);\n * // ➔ false\n * isArrayLike('abc');\n * // ➔ false\n */\nexport function isArrayLike<T extends { __anyHack: unknown }>(\n value: T\n): boolean;\nexport function isArrayLike(\n value: AnyFunction | null | undefined\n): value is never;\nexport function isArrayLike(value: unknown): value is { length: number };\nexport function isArrayLike(value: unknown) {\n return (\n !isFunction(value) && isObjectOrArray(value) && isLength(value?.length)\n );\n}\n","import type { AnyFunction } from \"@rzl-zone/ts-types-plus\";\nimport { isLength } from \"./isLength\";\nimport { isObjectOrArray } from \"./isObjectOrArray\";\n\n/** ----------------------------------------------------\n * * ***Type guard: `isArrayLikeObject`.***\n * ----------------------------------------------------\n * **This method is like ***`isArrayLike` utility function*** except that\n * it also checks if `value` is an object.**\n * @template T - The type of the value being checked.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `array-like object`, else `false`.\n * @example\n * isArrayLikeObject([1, 2, 3]);\n * // ➔ true\n * isArrayLikeObject(document.body.children);\n * // ➔ true\n * isArrayLikeObject('abc');\n * // ➔ false\n * isArrayLikeObject(noop);\n * // ➔ false\n */\nexport function isArrayLikeObject<T extends { __anyHack: unknown }>(\n value: T\n): boolean;\nexport function isArrayLikeObject(\n value: AnyFunction | string | boolean | number | null | undefined\n): value is never;\nexport function isArrayLikeObject(\n value: unknown\n): value is object & { length: number };\nexport function isArrayLikeObject(value: unknown) {\n return isObjectOrArray(value) && isLength(value.length);\n}\n","import { isNumber } from \"./isNumber\";\nimport { isString } from \"./isString\";\nimport { parseCurrencyString } from \"@/conversions/currency/parsing\";\n\n/** -----------------------------------------------------------\n * * ***Predicate: `isCurrencyLike`.***\n * -----------------------------------------------------------\n * **Determines if the given `input` can be interpreted as a currency-like number,\n * using the same **multi-locale parsing logic** as ***`parseCurrencyString`***.**\n * - **Highlights:**\n * - *Supports strings or numbers like:*\n * - `\"15.000,10\"` ***(European)***.\n * - `\"15,000.10\"` ***(US)***.\n * - `\"15'000.10\"` ***(Swiss)***.\n * - `\"15 000,10\"` ***(French)***.\n * - `\"Rp 15.000,10\"` or `\"$15,000.10\"`.\n * - Also accepts simple numbers (`15300.95`).\n * - **ℹ️ Note:**\n * - Uses the same core logic as\n * ***`parseCurrencyString`*** but\n * just checks if a final parsed float is sensible.\n * @param {*} input - The input value to check.\n * @returns {boolean} Return `true` if it can be reasonably parsed into a currency-like number, `false` otherwise.\n * @example\n * isCurrencyLike(15300.95);\n * // ➔ true\n * isCurrencyLike(\"$15,000.10\");\n * // ➔ true\n * isCurrencyLike(\"(15'000.10)\");\n * // ➔ true\n * isCurrencyLike(\"Rp 15.000,10\");\n * // ➔ true\n * isCurrencyLike(\"\");\n * // ➔ false\n * isCurrencyLike(\"abc\");\n * // ➔ false\n */\nexport const isCurrencyLike = (input: unknown): boolean => {\n if (!(isString(input) || isNumber(input))) return false;\n\n const parsed = parseCurrencyString(input.toString());\n // If parseCurrencyString returns a meaningful number (not just fallback zero for empty/invalid input)\n if (parsed !== 0) return true;\n\n // Special case: if input was exactly \"0\", still valid\n return input.toString().trim() === \"0\";\n};\n","import { isMap } from \"./isMap\";\nimport { isSet } from \"./isSet\";\nimport { isDate } from \"./isDate\";\nimport { isArray } from \"./isArray\";\nimport { isRegExp } from \"./isRegExp\";\nimport { isSymbol } from \"./isSymbol\";\nimport { isObjectOrArray } from \"./isObjectOrArray\";\n\n/** ----------------------------------------------------------\n * * ***Predicate: `isDeepEqual`.***\n * ----------------------------------------------------------\n * **Performs a deep equality check between two values.**\n * - **Behavior:**\n * - Compares nested `arrays`, `objects`, `Dates`, `RegExp`, `NaN`, `Symbols`,\n * `Set`, and `Map`.\n * - Handles special cases:\n * - `NaN` is considered equal to `NaN`.\n * - `Date` objects are equal if `.getTime()` is equal.\n * - `RegExp` objects are equal if `.toString()` is equal.\n * - `Symbol(\"x\")` and `Symbol(\"x\")` are treated equal if\n * `.toString()` matches.\n * - `Set` and `Map` are deeply compared by content (order-insensitive).\n * - **ℹ️ Note:**\n * - Does not support circular references.\n * @param {*} a - First value to compare.\n * @param {*} b - Second value to compare.\n * @returns {boolean} `true` if both values are deeply equal, otherwise `false`.\n * @example\n * // ✅ Primitives\n * isDeepEqual(1, 1);\n * // ➔ true\n * isDeepEqual(NaN, NaN);\n * // ➔ true\n * isDeepEqual(\"hello\", \"world\");\n * // ➔ false\n *\n * // ✅ Objects\n * isDeepEqual({ x: 1 }, { x: 1 });\n * // ➔ true\n * isDeepEqual({ x: 1 }, { y: 1 });\n * // ➔ false\n *\n * // ✅ Arrays\n * isDeepEqual([1, 2], [1, 2]);\n * // ➔ true\n * isDeepEqual([1, 2], [2, 1]);\n * // ➔ false\n *\n * // ✅ Dates\n * isDeepEqual(new Date(123), new Date(123));\n * // ➔ true\n *\n * // ✅ Sets\n * isDeepEqual(new Set([1, 2]), new Set([2, 1]));\n * // ➔ true\n *\n * // ✅ Maps\n * isDeepEqual(new Map([[\"a\", 1]]), new Map([[\"a\", 1]]));\n * // ➔ true\n *\n * // ❌ Different types\n * isDeepEqual(1, \"1\");\n * // ➔ false\n */\nexport const isDeepEqual = (a: unknown, b: unknown): boolean => {\n // Handle NaN\n if (\n typeof a === \"number\" &&\n typeof b === \"number\" &&\n Number.isNaN(a) &&\n Number.isNaN(b)\n ) {\n return true;\n }\n\n // Primitive equality\n if (a === b) return true;\n\n // Type mismatch\n if (typeof a !== typeof b) return false;\n\n // Date\n if (isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n\n // RegExp\n if (isRegExp(a) && isRegExp(b)) {\n return a.toString() === b.toString();\n }\n\n // Symbol\n if (isSymbol(a) && isSymbol(b)) {\n return a.toString() === b.toString();\n }\n\n // Set\n if (isSet(a) && isSet(b)) {\n if (a.size !== b.size) return false;\n const bValues = Array.from(b);\n const matched = new Set<number>();\n\n for (const aVal of a) {\n let found = false;\n for (let i = 0; i < bValues.length; i++) {\n if (matched.has(i)) continue;\n if (isDeepEqual(aVal, bValues[i])) {\n matched.add(i);\n found = true;\n break;\n }\n }\n if (!found) return false;\n }\n return true;\n }\n\n // Map\n if (isMap(a) && isMap(b)) {\n if (a.size !== b.size) return false;\n const bEntries = Array.from(b);\n const matched = new Set<number>();\n\n for (const [aKey, aVal] of a) {\n let found = false;\n for (let i = 0; i < bEntries.length; i++) {\n if (matched.has(i)) continue;\n const [bKey, bVal] = bEntries[i] ?? [];\n if (isDeepEqual(aKey, bKey) && isDeepEqual(aVal, bVal)) {\n matched.add(i);\n found = true;\n break;\n }\n }\n if (!found) return false;\n }\n return true;\n }\n\n // Array\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) return false;\n return a.every((item, i) => isDeepEqual(item, b[i]));\n }\n\n // Object\n if (isObjectOrArray(a) && isObjectOrArray(b) && a && b) {\n if (isArray(a) !== isArray(b)) return false;\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) return false;\n\n return aKeys.every((key) => isDeepEqual(a[key], b[key]));\n }\n\n return false;\n};\n","import { isPlainObject } from \"./isPlainObject\";\n\n/** ----------------------------------------------------\n * * ***Type guard: `isElement`.***\n * ----------------------------------------------------------\n * **Checks if `value` is likely a\n * **[`DOM Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**.**\n * @template T - The type of the value being checked.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is extends instance of **[`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**, else `false`.\n * @example\n * isElement(document.body);\n * // ➔ true\n * isElement(document.createElement(\"div\"));\n * // ➔ true\n * isElement('<body>');\n * // ➔ false\n * isElement(document);\n * // ➔ false\n * isElement({ tagName: \"DIV\" });\n * // ➔ false\n */\nexport function isElement(value: []): value is [];\nexport function isElement<T extends Element>(value: T): value is T;\nexport function isElement(value: unknown): value is Element;\nexport function isElement(value: unknown) {\n return (\n !!value &&\n typeof value === \"object\" &&\n (value as Element)?.nodeType === 1 &&\n !isPlainObject(value)\n );\n // return typeof Element === \"function\" && value instanceof Element;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { List, EmptyObjectOf } from \"./_private/types.isEmpty\";\n\nimport { isNil } from \"./isNil\";\nimport { isMap } from \"./isMap\";\nimport { isSet } from \"./isSet\";\nimport { isArray } from \"./isArray\";\nimport { isBuffer } from \"./isBuffer\";\nimport { isNumber } from \"./isNumber\";\nimport { isSymbol } from \"./isSymbol\";\nimport { isString } from \"./isString\";\nimport { isBoolean } from \"./isBoolean\";\nimport { isFunction } from \"./isFunction\";\nimport { isArguments } from \"./isArgument\";\nimport { isTypedArray } from \"./isTypedArray\";\nimport { isPlainObject } from \"./isPlainObject\";\n\n/** ----------------------------------------------------\n * * ***Predicate: `isEmpty`.***\n * ----------------------------------------------------------\n * **Checks if `value` is an empty object, collection, map, or set.**\n * - **Behavior:**\n * - **Objects** are empty if they have no own enumerable string keyed properties.\n * - **Array-like values** (arrays, strings, `arguments`, typed arrays, buffers)\n * are empty if their `length` is `0`.\n * - **Maps** and **Sets** are empty if their `size` is `0`.\n * - **Booleans**, **numbers** (including `NaN`), **symbols**, and `null`/\n * `undefined` are treated as empty.\n * - **Functions** are considered empty if they have no own enumerable keys.\n * - **ℹ️ Note:**\n * - For more `Strict`, you can use\n * ***`isEmptyValue` utility function*** instead.\n * @template T - The type of the value being checked.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n * isEmpty(null);\n * // ➔ true\n * isEmpty(true);\n * // ➔ true\n * isEmpty(false);\n * // ➔ true\n * isEmpty(1);\n * // ➔ true\n * isEmpty(0);\n * // ➔ true\n * isEmpty(Symbol(\"x\"));\n * // ➔ true\n * isEmpty(() => {});\n * // ➔ true\n * isEmpty(\"\");\n * // ➔ true\n * isEmpty(\" \");\n * // ➔ false\n * isEmpty([1, 2, 3]);\n * // ➔ false\n * isEmpty({ 'a': 1 });\n * // ➔ false\n */\nexport function isEmpty<T extends { __trapAny: any }>(value?: T): boolean;\nexport function isEmpty(value: string): value is \"\";\nexport function isEmpty(\n value: Map<any, any> | Set<any> | List<any> | null | undefined\n): boolean;\nexport function isEmpty(value: object): boolean;\nexport function isEmpty<T extends object>(\n value: T | null | undefined\n): value is EmptyObjectOf<T> | null | undefined;\nexport function isEmpty(value: any): boolean;\nexport function isEmpty(value: unknown) {\n // null / undefined\n if (isNil(value)) return true;\n\n // Boolean, number, symbol\n if (\n isBoolean(value) ||\n isNumber(value, { includeNaN: true }) ||\n isSymbol(value)\n )\n return true;\n\n // Function ➔ treat like object: check own enumerable keys\n if (isFunction(value)) {\n return Object.keys(value).length === 0;\n }\n\n // String / Array-like\n if (\n isString(value) ||\n isArray(value) ||\n isArguments(value) ||\n isTypedArray(value)\n ) {\n return value.length === 0;\n }\n\n // Map / Set\n if (isMap(value) || isSet(value)) {\n return value.size === 0;\n }\n\n // Buffer\n if (isBuffer(value)) {\n return value.length === 0;\n }\n\n // Object (check own enumerable keys)\n if (isPlainObject(value)) {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n","import { isNaN } from \"./isNaN\";\nimport { isArray } from \"./isArray\";\nimport { isString } from \"./isString\";\nimport { isNumber } from \"./isNumber\";\nimport { isEmptyArray } from \"./isEmptyArray\";\nimport { isEmptyString } from \"./isEmptyString\";\nimport { isObjectOrArray } from \"./isObjectOrArray\";\n\n/** ----------------------------------------------------------\n * * ***Predicate: `isEmptyDeep`.***\n * ----------------------------------------------------------\n * **Recursively checks whether a value is **deeply empty**.**\n * - **Returns `true` for:**\n * - Empty objects: `{}`\n * - Empty arrays: `[]`\n * - Nested empty structures: `{ a: [], b: {} }`\n * - Falsy values (except numbers): `null`, `undefined`, `false`, `\"\"`, `NaN`\n * - **Returns `false` for:**\n * - Non-zero numbers\n * - Objects or arrays containing non-empty values\n * - Non-empty strings, `true`, functions, symbols, etc.\n * @param {*} value - The value to deeply check.\n * @returns {boolean} `true` if the value is deeply empty, otherwise `false`.\n * @example\n * isEmptyDeep({});\n * // ➔ true\n * isEmptyDeep([]);\n * // ➔ true\n * isEmptyDeep({ a: {} });\n * // ➔ true\n * isEmptyDeep([[], {}]);\n * // ➔ true\n * isEmptyDeep({ a: [1] });\n * // ➔ false\n * isEmptyDeep([0]);\n * // ➔ false\n * isEmptyDeep(\"test\");\n * // ➔ false\n * isEmptyDeep(\"\");\n * // ➔ true\n * isEmptyDeep(0);\n * // ➔ false\n * isEmptyDeep(NaN);\n * // ➔ true\n */\nexport const isEmptyDeep = (value: unknown): boolean => {\n if (isString(value)) return isEmptyString(value);\n // Number ➔ only NaN counts as empty\n if (isNumber(value)) return isNaN(value);\n if (isArray(value)) {\n return isEmptyArray(value) || value.every(isEmptyDeep);\n }\n if (isObjectOrArray(value)) {\n const keys = Object.keys(value);\n const symbols = Object.getOwnPropertySymbols(value);\n\n if (keys.length === 0 && symbols.length === 0) return true;\n\n return [...keys, ...symbols].every((key) => isEmptyDeep(value[key]));\n }\n if (!value) return true;\n\n return false;\n};\n","import type { CustomizerIsEqualWith } from \"./_private/types.isEqualWith\";\nimport { baseDeepEqual } from \"@/predicates/is/_private/baseDeepEqual\";\n\n/** ----------------------------------------------------\n * * ***Predicate: `isEqualWith`.***\n * ----------------------------------------------------\n * **Performs a deep comparison between two values with support for a\n * customizer function.**\n * @description\n * This method is like ***`isEqual` utility function*** except that it\n * accepts a `customizer` which is invoked to compare values.\n * - **Behavior:**\n * - If `customizer` returns `undefined`, the comparison is handled by\n * the default deep equality algorithm.\n * - The `customizer` is invoked with up to six arguments:\n * - `(value, other, indexOrKey, parent, otherParent, stack)`,\n * see **{@link CustomizerIsEqualWith | `CustomizerIsEqualWith`}**.\n * - Supports comparing `arrays`, `objects`, `maps`, `sets`, `dates`,\n * `regexes`, `typed arrays`, `etc`.\n * - Functions and DOM nodes are **not** supported.\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {CustomizerIsEqualWith} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n * function isGreeting(value: unknown) {\n * return typeof value === \"string\" && /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue: unknown, othValue: unknown) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * const array = [\"hello\", \"goodbye\"];\n * const other = [\"hi\", \"goodbye\"];\n *\n * isEqualWith(array, other, customizer);\n * // ➔ true\n */\nexport function isEqualWith(\n value: unknown,\n other: unknown,\n customizer?: CustomizerIsEqualWith\n): boolean {\n return baseDeepEqual(value, other, customizer, new WeakMap());\n}\n","import type { CustomizerIsMatchWith } from \"./_private/types.isMatchWith\";\nimport { baseIsMatch } from \"@/predicates/is/_private/baseIsMatch\";\n\n/** ----------------------------------------------------\n * * ***Predicate: `isMatchWith`.***\n * ----------------------------------------------------\n * **Performs a partial deep comparison between `object` and `source`, like `isMatch`, but with a `customizer` function to control comparisons.**\n * @description\n * If `customizer` returns a value other than `undefined`, that value is used\n * as the result of the comparison for the current property. Otherwise,\n * the comparison falls back to the default deep equality logic.\n * - **Behavior:**\n * - The `customizer` function is invoked with up to **five** arguments:\n * - `(objValue, srcValue, keyOrIndex, object, source)`,\n * see **{@link CustomizerIsMatchWith | `CustomizerIsMatchWith`}**.\n * - Returning `true` from `customizer` will short-circuit further comparison\n * for that key.\n * - Returning `false` will cause `isMatchWith` to return `false` immediately.\n * - Returning `undefined` allows default comparison to proceed.\n * @param {object} value - The object to inspect.\n * @param {object} other - The object of property values to match.\n * @param {CustomizerIsMatchWith} [customizer] - The function to customize comparisons.\n * @returns Returns `true` if `object` is a match, else `false`.\n * @example\n * function isGreeting(value: unknown) {\n * return typeof value === 'string' && /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue: unknown, srcValue: unknown) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * const object = { greeting: 'hello' };\n * const source = { greeting: 'hi' };\n *\n * isMatchWith(object, source, customizer);\n * // ➔ true\n */\nexport function isMatchWith(\n value: object,\n other: object,\n customizer?: CustomizerIsMatchWith\n): boolean {\n return baseIsMatch(value, other, customizer);\n}\n","import type { CustomizerIsMatchWith } from \"./types.isMatchWith\";\n\nimport { isArray } from \"../isArray\";\nimport { isUndefined } from \"../isUndefined\";\nimport { isMatchWith } from \"../isMatchWith\";\nimport { isObjectOrArray } from \"../isObjectOrArray\";\n\n// #Private - local\nfunction isSameValue(x: unknown, y: unknown): boolean {\n return (\n x === y || (x === 0 && y === 0) || (Number.isNaN(x) && Number.isNaN(y))\n );\n}\n\n/** -------------------------------------------------------------------\n * * ***Base function (**Internal**) for matching objects with optional customizer.***\n * -------------------------------------------------------------------\n * **Recursively checks whether `object` matches `source`. Supports custom comparison\n * via `customizer`, and handles arrays, objects, and nested structures.**\n * @param object\n * - The object to test against the `source`.\n * @param source\n * - The source object to match.\n * @param customizer\n * - Optional function to customize the comparison for each property/value.\n * @returns\n * - `true` → `object` matches `source`.\n * - `false` → `object` does not match `source`.\n * @example\n * ```ts\n * const obj = { name: \"Alice\", age: 30 };\n * const src = { name: \"alice\" };\n * const customizer: CustomizerIsMatchWith = (value, other) => {\n * if (typeof value === \"string\" && typeof other === \"string\") {\n * return value.toLowerCase() === other.toLowerCase();\n * }\n * };\n *\n * baseIsMatch(obj, src, customizer);\n * // returns true\n * ```\n */\nexport function baseIsMatch(\n object: unknown,\n source: unknown,\n customizer?: CustomizerIsMatchWith\n): boolean {\n if (object === source) return true;\n\n if (!isObjectOrArray(source)) {\n return isSameValue(object, source);\n }\n\n if (!isObjectOrArray(object)) {\n return false;\n }\n\n const keys = Reflect.ownKeys(source).filter(\n (k) => !(isArray(source) && k === \"length\")\n );\n\n for (const key of keys) {\n if (!(key in object)) return false;\n\n const objValue = object[key];\n const srcValue = source[key];\n\n const result = customizer?.(objValue, srcValue, key, object, source);\n if (!isUndefined(result)) {\n if (!result) return false;\n continue; // skip default comparison\n }\n\n if (isObjectOrArray(objValue) && isObjectOrArray(srcValue)) {\n if (!isMatchWith(objValue, srcValue, customizer)) return false;\n } else {\n if (!isSameValue(objValue, srcValue)) return false;\n }\n }\n\n return true;\n}\n","import { baseIsMatch } from \"@/predicates/is/_private/baseIsMatch\";\n\n/** ----------------------------------------------------\n * * ***Predicate: `isMatch`.***\n * ----------------------------------------------------\n * **Performs a partial deep comparison between `object` and `source`.**\n * @description\n * Determines whether `object` contains equivalent property values from `source`.\n * - **Behavior:**\n * - ✅ Returns `true` if **all properties** in `source` exist in `object` and are deeply equal.\n * - ❌ Does **not** require `object` and `source` to be the same shape—`object` may have extra properties.\n * - ⚠️ Arrays are treated as objects: only matching indexed keys are compared.\n * - **Remarks:**\n * - This is functionally equivalent to a partially applied `matches(source)` predicate.\n * - Special cases:\n * - An empty array (`[]`) in `source` matches any array in `object`.\n * - An empty object (`{}`) in `source` matches any object in `object`.\n * @param {object} object - The object to inspect.\n * @param {object} source - The object containing property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n * const object = { a: 1, b: 2 };\n *\n * isMatch(object, { b: 2 });\n * // ➔ true\n * isMatch(object, { b: 1 });\n * // ➔ false\n * isMatch([1, 2, 3], [1, 2]);\n * // ➔ true (treats arrays as objects with index keys)\n */\nexport function isMatch(object: object, source: object): boolean {\n return baseIsMatch(object, source);\n}\n","import type { AnyFunction } from \"@rzl-zone/ts-types-plus\";\nimport { isFunction } from \"./isFunction\";\n\nconst funcToString = Function.prototype.toString;\nconst reIsNative = /\\{\\s*\\[native code\\]\\s*\\}/;\n\n/** ----------------------------------------------------\n * * ***Type guard: `isNative`.***\n * ----------------------------------------------------------\n * **Checks if a value is a **pristine native function**.**\n * - **ℹ️ Note:**\n * - This method may not reliably detect native functions when using packages\n * like `core-js`, as they override native behavior.\n * - Attempts to detect native functions in such environments may fail or\n * throw errors.\n * - This also affects packages like\n * **[`babel-polyfill`](https://www.npmjs.com/package/babel-polyfill).**\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n * isNative(Array.prototype.push);\n * // ➔ true\n *\n * import * as RzlUtilsJs from \"@rzl-zone/utils-js/predicates\";\n * isNative(RzlUtilsJs);\n * // ➔ false\n */\nexport function isNative(value: unknown): value is AnyFunction {\n if (!isFunction(value)) return false;\n\n try {\n const source = funcToString.call(value);\n return reIsNative.test(source);\n } catch {\n return false;\n }\n}\n","import { isNil } from \"./isNil\";\nimport { isFunction } from \"./isFunction\";\nimport { isObjectOrArray } from \"./isObjectOrArray\";\n\n/** ----------------------------------------------------------\n * * ***Type guard: `isObjectLoose`.***\n * ----------------------------------------------------------\n * **Checks if a value is the\n * [ECMAScript language type ***Object***](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types).**\n * - **✅ Returns `true` for:**\n * - Plain objects (`{}`)\n * - Arrays (`[]`)\n * - Functions\n * - Regexes (`/abc/`)\n * - Boxed primitives:\n * - `new Number(0)`\n * - `new String(\"\")`\n * - `new Boolean(false)`\n * - **❌ Returns `false` for:**\n * - `null`\n * - `undefined`\n * - Primitives:\n * - `string`\n * - `number`\n * - `boolean`\n * - `symbol`\n * - `bigint`\n * - **ℹ️ Note:**\n * - **For More Strict Object Use ***`isObject`*** or ***`isPlainObject` utility function*** instead.**\n * @template T - The type of the value being checked.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n * isObjectLoose({});\n * // ➔ true\n * isObjectLoose([1, 2, 3]);\n * // ➔ true\n * isObjectLoose(()=> {});\n * // ➔ true\n * isObjectLoose(null);\n * // ➔ false\n * isObjectLoose(undefined);\n * // ➔ false\n */\nexport function isObjectLoose<T = object>(value: unknown): value is T {\n return !isNil(value) && (isObjectOrArray(value) || isFunction(value));\n}\n","/** --------------------------------------------------\n * * ***Type guard: `isSafeInteger`.***\n * --------------------------------------------------\n * **Checks if `value` is a **[`Safe-Integer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger)**.**\n * - **Behavior:**\n * - Narrows type to `number` when true.\n * - **An integer is considered *safe* if:**\n * - It is an `IEEE-754` **double precision number**.\n * - It can be exactly represented without rounding errors.\n * - It lies within the range **-(2^53 - 1) to 2^53 - 1**.\n * - **Note:**\n * - This method is based on **{@link Number.isSafeInteger | `Number.isSafeInteger`}**.\n * @param {*} value - The value to check.\n * @returns {boolean} Return `true` if `value` is a safe integer, otherwise `false`.\n * @example\n * isSafeInteger(3);\n * // ➔ true\n * isSafeInteger(Number.MIN_VALUE);\n * // ➔ false\n * isSafeInteger(Infinity);\n * // ➔ false\n * isSafeInteger('3');\n * // ➔ false\n */\nexport function isSafeInteger(value: unknown): value is number {\n return typeof value === \"number\" && Number.isSafeInteger(value);\n}\n","import { isNonEmptyString } from \"./isNonEmptyString\";\n\n/** ---------------------------------------------------------\n * * ***Predicate: `isValidURL`.***\n * ---------------------------------------------------------\n * **Validates whether a given string is a properly formatted URL.**\n * - **Ensures that the input is:**\n * - A non-empty string.\n * - A valid **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** with `http://` or `https://` scheme.\n * - **Behavior:**\n * - ✅ Includes decoding for percent-encoded URLs (e.g., `https%3A%2F%2F...`).\n * - ❌ Rejects invalid strings, unsupported schemes, and malformed domains.\n * @param {*} url - The value to validate.\n * @returns {boolean} Return `true` if the value is a **valid URL string**, otherwise `false`.\n * @example\n * isValidURL(\"https://example.com\");\n * // ➔ true\n * isValidURL(\"ftp://example.com\");\n * // ➔ false\n * isValidURL(\"not-a-url\");\n * // ➔ false\n */\nexport const isValidURL = (url: unknown): boolean => {\n if (!isNonEmptyString(url)) return false;\n\n // Attempt to decode the entire URL, including domain and query parameters\n let decodedUrl: string;\n\n try {\n // Decode the URL (to handle cases like https%3A%2F%2F becoming https://)\n decodedUrl = decodeURIComponent(url);\n } catch {\n // If decoding fails, return false as it indicates an invalid encoded URL\n return false;\n }\n\n // Check if the decoded URL starts with http:// or https://\n if (!decodedUrl.startsWith(\"http://\") && !decodedUrl.startsWith(\"https://\")) {\n return false;\n }\n\n // the original more extra\n const urlPattern = new RegExp(\n /^https?:\\/\\/(?:localhost(?::\\d+)?(?:[/?#][^\\s]*)?|(?:www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}(?::\\d+)?(?:[/?#][^\\s]*)?)$/\n );\n\n // Test the decoded URL against the regex pattern\n return urlPattern.test(decodedUrl);\n};\n","import { isNull } from \"./isNull\";\nimport { isObject } from \"./isObject\";\n\n/** --------------------------------------------------\n * * ***Type guard: `isWeakMap`.***\n * ----------------------------------------------------------\n * **Checks if a value is a **[`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/WeakMap)** object.**\n * - **Behavior:**\n * - Narrows type to `WeakMap<K, V>` when true.\n * - Excludes `Map`, `arrays`, `plain-objects,` and `other non-WeakMap values`.\n * @template K - Keys must be objects.\n * @template V - Type of values stored in the WeakMap.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the value is a `WeakMap`, otherwise `false`.\n * @example\n * isWeakMap(new WeakMap);\n * // ➔ true\n * isWeakMap(new Map);\n * // ➔ false\n */\nexport function isWeakMap<K extends object = object, V = unknown>(\n value: unknown\n): value is WeakMap<K, V> {\n return isObject(value) && !isNull(value) && value instanceof WeakMap;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAa,kBACX,QACA,QACA,cAAuB,UACX;CACZ,IAAI,EAAEA,gCAAQ,MAAM,KAAKA,gCAAQ,MAAM,IACrC,MAAM,IAAI,UACR,6IAA6IC,uCAC3I,MACF,EAAE,kBAAkBA,uCAAe,MAAM,EAAE,KAC7C;CAGF,wCAAgB,aAAa,EAC3B,UAAU,EAAE,aAAa,gBACvB,qDAAqD,UAAU,sBAAsB,YAAY,KACrG,CAAC;CAED,IAAI,CAACC,wBAAQ,OAAO,QAAQ,OAAO,MAAM,GAAG,OAAO;;;;;;;;CASnD,MAAM,mBAAmB,QAA8B;EACrD,IAAI,CAACF,gCAAQ,GAAG,GAAG,OAAO;EAW1B,OARe,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