@rzl-zone/utils-js 3.13.1-beta.0 → 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.
Files changed (281) hide show
  1. package/README.md +7 -6
  2. package/dist/.references/index.d.cts +2 -1
  3. package/dist/.references/index.d.ts +2 -1
  4. package/dist/AbortError-DK6kpzbu.cjs +26 -0
  5. package/dist/AbortError-DK6kpzbu.cjs.map +1 -0
  6. package/dist/AbortError-DVT8lAKn.js +20 -0
  7. package/dist/AbortError-DVT8lAKn.js.map +1 -0
  8. package/dist/{assertIsArray-DrLORH0Y.js → assertIsArray-CG7L7vlt.js} +3 -3
  9. package/dist/assertIsArray-CG7L7vlt.js.map +1 -0
  10. package/dist/{assertIsArray-CqIFmlgj.cjs → assertIsArray-CtCRD-_G.cjs} +5 -5
  11. package/dist/assertIsArray-CtCRD-_G.cjs.map +1 -0
  12. package/dist/assertIsPlainObject-DPZLj-Ho.cjs +26 -0
  13. package/dist/assertIsPlainObject-DPZLj-Ho.cjs.map +1 -0
  14. package/dist/assertIsPlainObject-j9bDqNLo.js +20 -0
  15. package/dist/assertIsPlainObject-j9bDqNLo.js.map +1 -0
  16. package/dist/{assertIsString-1iLqxrN0.js → assertIsString-CHIwE12y.js} +4 -4
  17. package/dist/assertIsString-CHIwE12y.js.map +1 -0
  18. package/dist/{assertIsString-DGDLC-XD.cjs → assertIsString-CjE9kbQ_.cjs} +6 -6
  19. package/dist/assertIsString-CjE9kbQ_.cjs.map +1 -0
  20. package/dist/assertions/index.cjs +14 -12
  21. package/dist/assertions/index.cjs.map +1 -1
  22. package/dist/assertions/index.d.cts +2 -2
  23. package/dist/assertions/index.d.ts +2 -2
  24. package/dist/assertions/index.js +10 -8
  25. package/dist/assertions/index.js.map +1 -1
  26. package/dist/conversions/index.cjs +6 -6
  27. package/dist/conversions/index.d.cts +2 -2
  28. package/dist/conversions/index.d.ts +2 -2
  29. package/dist/conversions/index.js +6 -6
  30. package/dist/conversions-BFz6MKaV.cjs +449 -0
  31. package/dist/conversions-BFz6MKaV.cjs.map +1 -0
  32. package/dist/{conversions-CA_3PTAH.js → conversions-Ben5p5Ts.js} +43 -40
  33. package/dist/conversions-Ben5p5Ts.js.map +1 -0
  34. package/dist/errors/index.cjs +13 -0
  35. package/dist/errors/index.d.cts +180 -0
  36. package/dist/errors/index.d.ts +180 -0
  37. package/dist/errors/index.js +11 -0
  38. package/dist/events/index.cjs +10 -9
  39. package/dist/events/index.cjs.map +1 -1
  40. package/dist/events/index.d.cts +185 -100
  41. package/dist/events/index.d.ts +185 -100
  42. package/dist/events/index.js +9 -8
  43. package/dist/events/index.js.map +1 -1
  44. package/dist/formatter-ekJQF_bA-BepnCBkQ.cjs +67 -0
  45. package/dist/formatter-ekJQF_bA-BepnCBkQ.cjs.map +1 -0
  46. package/dist/formatter-ekJQF_bA-xLD9mGk4.js +55 -0
  47. package/dist/formatter-ekJQF_bA-xLD9mGk4.js.map +1 -0
  48. package/dist/formatters/index.cjs +2 -2
  49. package/dist/formatters/index.d.cts +2 -2
  50. package/dist/formatters/index.d.ts +2 -2
  51. package/dist/formatters/index.js +2 -2
  52. package/dist/{formatters-Bm3a_akj.js → formatters-BAbGsnYA.js} +78 -71
  53. package/dist/formatters-BAbGsnYA.js.map +1 -0
  54. package/dist/formatters-zd0Gs4Cs.cjs +436 -0
  55. package/dist/formatters-zd0Gs4Cs.cjs.map +1 -0
  56. package/dist/generators/index.cjs +37 -31
  57. package/dist/generators/index.cjs.map +1 -1
  58. package/dist/generators/index.d.cts +2 -2
  59. package/dist/generators/index.d.ts +2 -2
  60. package/dist/generators/index.js +29 -23
  61. package/dist/generators/index.js.map +1 -1
  62. package/dist/hasOwnProp-CVIhlD1i.js +47 -0
  63. package/dist/hasOwnProp-CVIhlD1i.js.map +1 -0
  64. package/dist/hasOwnProp-D9Tpgokd.cjs +53 -0
  65. package/dist/hasOwnProp-D9Tpgokd.cjs.map +1 -0
  66. package/dist/{index-CakviK5E.d.cts → index-9JsU_wMu.d.ts} +1375 -937
  67. package/dist/{index-BqkYm8qT.d.ts → index-BP3sUrAx.d.ts} +242 -133
  68. package/dist/{index-CJx0EFQ4.d.cts → index-BVovC-yK.d.cts} +229 -200
  69. package/dist/index-C1X6ha9s.d.cts +1041 -0
  70. package/dist/index-CcPQZ41G.d.cts +1103 -0
  71. package/dist/index-CjpbuJF4.d.ts +2424 -0
  72. package/dist/index-CssrQyHh.d.cts +2424 -0
  73. package/dist/index-DZHiYYR7.d.cts +2179 -0
  74. package/dist/index-DZHiYYR7.d.ts +2179 -0
  75. package/dist/index-DlyDmXUo.d.ts +1103 -0
  76. package/dist/index-Dm4a___O.d.ts +1041 -0
  77. package/dist/{index-D5nTp1kV.d.ts → index-Dwduk7ez.d.cts} +1375 -937
  78. package/dist/{index-uaHl0X-r.d.cts → index-I5V6RbZM.d.cts} +1592 -790
  79. package/dist/{index-Bm5odgLW.d.ts → index-hOqBIL7F.d.ts} +1592 -790
  80. package/dist/{index-hOCUw-B9.d.ts → index-jyuOZMX7.d.ts} +229 -200
  81. package/dist/{index-BqkYm8qT.d.cts → index-lI0b7iUz.d.cts} +242 -133
  82. package/dist/{isBigInt-f6yY2fAV.js → isBigInt-Cez32M69.js} +2 -2
  83. package/dist/isBigInt-Cez32M69.js.map +1 -0
  84. package/dist/{isBigInt-CqZNWVtI.cjs → isBigInt-YgpNKTbA.cjs} +2 -2
  85. package/dist/isBigInt-YgpNKTbA.cjs.map +1 -0
  86. package/dist/{isEmptyString-Ga77_3Q1.js → isEmptyString-C9QLWjx2.js} +4 -4
  87. package/dist/isEmptyString-C9QLWjx2.js.map +1 -0
  88. package/dist/{isEmptyString-DNMPmS-H.cjs → isEmptyString-O4TFe1Ao.cjs} +5 -5
  89. package/dist/isEmptyString-O4TFe1Ao.cjs.map +1 -0
  90. package/dist/isEmptyValue-CFExALXZ.cjs +54 -0
  91. package/dist/isEmptyValue-CFExALXZ.cjs.map +1 -0
  92. package/dist/isEmptyValue-kCjnLjbN.js +36 -0
  93. package/dist/isEmptyValue-kCjnLjbN.js.map +1 -0
  94. package/dist/{isFinite-Crw95XV8.cjs → isFinite-B_hHbDpa.cjs} +6 -6
  95. package/dist/isFinite-B_hHbDpa.cjs.map +1 -0
  96. package/dist/{isFinite-BJO7Dt6B.js → isFinite-ZvNhyHlF.js} +5 -5
  97. package/dist/isFinite-ZvNhyHlF.js.map +1 -0
  98. package/dist/{isInteger-B75voxys.js → isInteger-aZgzTTZG.js} +4 -4
  99. package/dist/isInteger-aZgzTTZG.js.map +1 -0
  100. package/dist/{isInteger-CSMNm--9.cjs → isInteger-dnc6W63Z.cjs} +4 -4
  101. package/dist/isInteger-dnc6W63Z.cjs.map +1 -0
  102. package/dist/isNumber-BCWD4dW0.js +20 -0
  103. package/dist/isNumber-BCWD4dW0.js.map +1 -0
  104. package/dist/isNumber-BkzwAe50.cjs +26 -0
  105. package/dist/isNumber-BkzwAe50.cjs.map +1 -0
  106. package/dist/isPlainObject-CAe_ElKO.d.cts +331 -0
  107. package/dist/isPlainObject-CJvRG4Je.d.ts +331 -0
  108. package/dist/{isServer-BHOSvBhV.js → isServer-CQzrX5e0.js} +2 -2
  109. package/dist/isServer-CQzrX5e0.js.map +1 -0
  110. package/dist/{isServer-HA13Dzo2.cjs → isServer-DhFaedeT.cjs} +2 -2
  111. package/dist/isServer-DhFaedeT.cjs.map +1 -0
  112. package/dist/{isEqual-D8W3Wizi.cjs → isTypedArray-DjADSu8q.cjs} +45 -13
  113. package/dist/isTypedArray-DjADSu8q.cjs.map +1 -0
  114. package/dist/{isEqual-ekId-j5b.js → isTypedArray-DxsPKrLh.js} +29 -9
  115. package/dist/isTypedArray-DxsPKrLh.js.map +1 -0
  116. package/dist/{isValidDomain-BqyLVi7S.js → isValidDomain-CDtNOhMc.js} +13 -54
  117. package/dist/isValidDomain-CDtNOhMc.js.map +1 -0
  118. package/dist/{isValidDomain-ByrOfQsh.cjs → isValidDomain-D_x7uNIu.cjs} +16 -69
  119. package/dist/isValidDomain-D_x7uNIu.cjs.map +1 -0
  120. package/dist/{assertIsBoolean-DDhQ2D-k.js → logger-CLWnKRKE.js} +657 -587
  121. package/dist/logger-CLWnKRKE.js.map +1 -0
  122. package/dist/{assertIsBoolean-CEx4KbHg.cjs → logger-CUacYy3D.cjs} +658 -612
  123. package/dist/logger-CUacYy3D.cjs.map +1 -0
  124. package/dist/{noop-CkwxErJ2.cjs → noop-CjEbNsJL.cjs} +2 -2
  125. package/dist/noop-CjEbNsJL.cjs.map +1 -0
  126. package/dist/{noop-D_Ots__Z.js → noop-qxrcogt5.js} +2 -2
  127. package/dist/noop-qxrcogt5.js.map +1 -0
  128. package/dist/{normalizeSpaces-88yaixiu.cjs → normalizeSpaces-D0_Z4qnO.cjs} +6 -9
  129. package/dist/normalizeSpaces-D0_Z4qnO.cjs.map +1 -0
  130. package/dist/{normalizeSpaces-Cat8CHtt.js → normalizeSpaces-DAsxzBEQ.js} +4 -7
  131. package/dist/normalizeSpaces-DAsxzBEQ.js.map +1 -0
  132. package/dist/operations/index.cjs +152 -22
  133. package/dist/operations/index.cjs.map +1 -1
  134. package/dist/operations/index.d.cts +257 -35
  135. package/dist/operations/index.d.ts +257 -35
  136. package/dist/operations/index.js +142 -13
  137. package/dist/operations/index.js.map +1 -1
  138. package/dist/parsers/index.cjs +2 -2
  139. package/dist/parsers/index.d.cts +238 -180
  140. package/dist/parsers/index.d.ts +238 -180
  141. package/dist/parsers/index.js +2 -2
  142. package/dist/{parsers-BLHzVoh-.js → parsers-BBAE_xVM.js} +9 -8
  143. package/dist/parsers-BBAE_xVM.js.map +1 -0
  144. package/dist/{parsers-xAQmKCgS.cjs → parsers-i8WEeMJl.cjs} +10 -9
  145. package/dist/parsers-i8WEeMJl.cjs.map +1 -0
  146. package/dist/{parsing-BYo6U0EG.js → parsing-D9tbKQ0v.js} +3 -3
  147. package/dist/parsing-D9tbKQ0v.js.map +1 -0
  148. package/dist/{parsing-CuezVd0e.cjs → parsing-DGjB8cwr.cjs} +4 -4
  149. package/dist/parsing-DGjB8cwr.cjs.map +1 -0
  150. package/dist/predicates/index.cjs +43 -43
  151. package/dist/predicates/index.d.cts +3 -3
  152. package/dist/predicates/index.d.ts +3 -3
  153. package/dist/predicates/index.js +14 -14
  154. package/dist/{predicates-BMTIIYx8.js → predicates-C0dova7l.js} +45 -40
  155. package/dist/predicates-C0dova7l.js.map +1 -0
  156. package/dist/{predicates-ZmZpelMh.cjs → predicates-Dd7To7B4.cjs} +89 -84
  157. package/dist/predicates-Dd7To7B4.cjs.map +1 -0
  158. package/dist/promises/index.cjs +27 -26
  159. package/dist/promises/index.cjs.map +1 -1
  160. package/dist/promises/index.d.cts +227 -75
  161. package/dist/promises/index.d.ts +227 -75
  162. package/dist/promises/index.js +27 -26
  163. package/dist/promises/index.js.map +1 -1
  164. package/dist/{punyCode-WZ6-GaTM.cjs → punyCode-DHTLhGdD.cjs} +12 -12
  165. package/dist/punyCode-DHTLhGdD.cjs.map +1 -0
  166. package/dist/{punyCode-COTqgXMJ.js → punyCode-Deb1Mrkc.js} +12 -12
  167. package/dist/punyCode-Deb1Mrkc.js.map +1 -0
  168. package/dist/{removeSpaces-CQJvw1yU.js → removeSpaces-BPnsdRN0.js} +4 -4
  169. package/dist/removeSpaces-BPnsdRN0.js.map +1 -0
  170. package/dist/{removeSpaces-BeGkktUl.cjs → removeSpaces-CN3pxBz_.cjs} +7 -7
  171. package/dist/removeSpaces-CN3pxBz_.cjs.map +1 -0
  172. package/dist/rzl-utils.global.js +13 -13
  173. package/dist/safeJsonParse-D1FLVTEM.cjs +209 -0
  174. package/dist/safeJsonParse-D1FLVTEM.cjs.map +1 -0
  175. package/dist/{safeJsonParse-D8H3wCv7.js → safeJsonParse-DEVKNDSn.js} +29 -28
  176. package/dist/safeJsonParse-DEVKNDSn.js.map +1 -0
  177. package/dist/safeStableStringify-C5HHKUdn.cjs +125 -0
  178. package/dist/safeStableStringify-C5HHKUdn.cjs.map +1 -0
  179. package/dist/{safeStableStringify-BLwA1VC-.js → safeStableStringify-DfwxmiWn.js} +20 -13
  180. package/dist/safeStableStringify-DfwxmiWn.js.map +1 -0
  181. package/dist/strings/index.cjs +26 -30
  182. package/dist/strings/index.cjs.map +1 -1
  183. package/dist/strings/index.d.cts +2 -2
  184. package/dist/strings/index.d.ts +2 -2
  185. package/dist/strings/index.js +13 -17
  186. package/dist/strings/index.js.map +1 -1
  187. package/dist/tailwind/index.cjs +3 -3
  188. package/dist/tailwind/index.d.cts +3 -3
  189. package/dist/tailwind/index.d.ts +3 -3
  190. package/dist/tailwind/index.js +3 -3
  191. package/dist/{tailwind-CjxdO7aL.cjs → tailwind-BG7B0cDs.cjs} +59 -53
  192. package/dist/tailwind-BG7B0cDs.cjs.map +1 -0
  193. package/dist/{tailwind-RSE3obLb.js → tailwind-tJNnFPsF.js} +38 -32
  194. package/dist/tailwind-tJNnFPsF.js.map +1 -0
  195. package/dist/{toStringArrayUnRecursive-NreW1dyV.js → toStringArrayUnRecursive-D0WbLIRz.js} +9 -9
  196. package/dist/toStringArrayUnRecursive-D0WbLIRz.js.map +1 -0
  197. package/dist/toStringArrayUnRecursive-QLoaNX_-.cjs +51 -0
  198. package/dist/toStringArrayUnRecursive-QLoaNX_-.cjs.map +1 -0
  199. package/dist/urls/index.cjs +3 -3
  200. package/dist/urls/index.d.cts +635 -443
  201. package/dist/urls/index.d.ts +635 -443
  202. package/dist/urls/index.js +3 -3
  203. package/dist/{urls-CLVfEB7O.js → urls-EoWslGgg.js} +50 -41
  204. package/dist/urls-EoWslGgg.js.map +1 -0
  205. package/dist/urls-NCzPepe2.cjs +308 -0
  206. package/dist/urls-NCzPepe2.cjs.map +1 -0
  207. package/package.json +6 -6
  208. package/dist/assertIsArray-CqIFmlgj.cjs.map +0 -1
  209. package/dist/assertIsArray-DrLORH0Y.js.map +0 -1
  210. package/dist/assertIsBoolean-CEx4KbHg.cjs.map +0 -1
  211. package/dist/assertIsBoolean-DDhQ2D-k.js.map +0 -1
  212. package/dist/assertIsString-1iLqxrN0.js.map +0 -1
  213. package/dist/assertIsString-DGDLC-XD.cjs.map +0 -1
  214. package/dist/conversions-Bxa01uIl.cjs +0 -446
  215. package/dist/conversions-Bxa01uIl.cjs.map +0 -1
  216. package/dist/conversions-CA_3PTAH.js.map +0 -1
  217. package/dist/formatters-Bm3a_akj.js.map +0 -1
  218. package/dist/formatters-Bt6QuhxK.cjs +0 -429
  219. package/dist/formatters-Bt6QuhxK.cjs.map +0 -1
  220. package/dist/index--h04HuBE.d.cts +0 -765
  221. package/dist/index--h04HuBE.d.ts +0 -765
  222. package/dist/index-Ap8U-8Qx.d.cts +0 -947
  223. package/dist/index-BAeeggeh.d.cts +0 -1716
  224. package/dist/index-BAeeggeh.d.ts +0 -1716
  225. package/dist/index-CMglhpFG.d.ts +0 -947
  226. package/dist/isBigInt-CqZNWVtI.cjs.map +0 -1
  227. package/dist/isBigInt-f6yY2fAV.js.map +0 -1
  228. package/dist/isEmptyObject-BYNnSKzw.js +0 -25
  229. package/dist/isEmptyObject-BYNnSKzw.js.map +0 -1
  230. package/dist/isEmptyObject-C2lQyFZS.cjs +0 -37
  231. package/dist/isEmptyObject-C2lQyFZS.cjs.map +0 -1
  232. package/dist/isEmptyString-DNMPmS-H.cjs.map +0 -1
  233. package/dist/isEmptyString-Ga77_3Q1.js.map +0 -1
  234. package/dist/isEmptyValue-D7-6WWS9.js +0 -24
  235. package/dist/isEmptyValue-D7-6WWS9.js.map +0 -1
  236. package/dist/isEmptyValue-DZaDHEIw.cjs +0 -30
  237. package/dist/isEmptyValue-DZaDHEIw.cjs.map +0 -1
  238. package/dist/isEqual-D8W3Wizi.cjs.map +0 -1
  239. package/dist/isEqual-ekId-j5b.js.map +0 -1
  240. package/dist/isFinite-BJO7Dt6B.js.map +0 -1
  241. package/dist/isFinite-Crw95XV8.cjs.map +0 -1
  242. package/dist/isInteger-B75voxys.js.map +0 -1
  243. package/dist/isInteger-CSMNm--9.cjs.map +0 -1
  244. package/dist/isPlainObject-ByfuseCf.d.cts +0 -339
  245. package/dist/isPlainObject-ByfuseCf.d.ts +0 -339
  246. package/dist/isServer-BHOSvBhV.js.map +0 -1
  247. package/dist/isServer-HA13Dzo2.cjs.map +0 -1
  248. package/dist/isTypedArray-CWlHRz_O.cjs +0 -43
  249. package/dist/isTypedArray-CWlHRz_O.cjs.map +0 -1
  250. package/dist/isTypedArray-CmnQ7Yx9.js +0 -31
  251. package/dist/isTypedArray-CmnQ7Yx9.js.map +0 -1
  252. package/dist/isValidDomain-BqyLVi7S.js.map +0 -1
  253. package/dist/isValidDomain-ByrOfQsh.cjs.map +0 -1
  254. package/dist/noop-CkwxErJ2.cjs.map +0 -1
  255. package/dist/noop-D_Ots__Z.js.map +0 -1
  256. package/dist/normalizeSpaces-88yaixiu.cjs.map +0 -1
  257. package/dist/normalizeSpaces-Cat8CHtt.js.map +0 -1
  258. package/dist/parsers-BLHzVoh-.js.map +0 -1
  259. package/dist/parsers-xAQmKCgS.cjs.map +0 -1
  260. package/dist/parsing-BYo6U0EG.js.map +0 -1
  261. package/dist/parsing-CuezVd0e.cjs.map +0 -1
  262. package/dist/predicates-BMTIIYx8.js.map +0 -1
  263. package/dist/predicates-ZmZpelMh.cjs.map +0 -1
  264. package/dist/punyCode-COTqgXMJ.js.map +0 -1
  265. package/dist/punyCode-WZ6-GaTM.cjs.map +0 -1
  266. package/dist/removeSpaces-BeGkktUl.cjs.map +0 -1
  267. package/dist/removeSpaces-CQJvw1yU.js.map +0 -1
  268. package/dist/safeJsonParse-BznDD3fi.cjs +0 -208
  269. package/dist/safeJsonParse-BznDD3fi.cjs.map +0 -1
  270. package/dist/safeJsonParse-D8H3wCv7.js.map +0 -1
  271. package/dist/safeStableStringify-4b-E_UHM.cjs +0 -106
  272. package/dist/safeStableStringify-4b-E_UHM.cjs.map +0 -1
  273. package/dist/safeStableStringify-BLwA1VC-.js.map +0 -1
  274. package/dist/tailwind-CjxdO7aL.cjs.map +0 -1
  275. package/dist/tailwind-RSE3obLb.js.map +0 -1
  276. package/dist/toStringArrayUnRecursive-D-jHROts.cjs +0 -51
  277. package/dist/toStringArrayUnRecursive-D-jHROts.cjs.map +0 -1
  278. package/dist/toStringArrayUnRecursive-NreW1dyV.js.map +0 -1
  279. package/dist/urls-C6BvhrrV.cjs +0 -299
  280. package/dist/urls-C6BvhrrV.cjs.map +0 -1
  281. package/dist/urls-CLVfEB7O.js.map +0 -1
@@ -2,231 +2,289 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1-beta.0`
5
+ * Version: `3.14.0-beta.0`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
9
9
  */
10
10
  type ExtractFileNameOptions = {
11
- /** ----------------------------------------------------------
11
+ /** ------------------------------------------------------------------------------------
12
12
  * * ***Indicates whether the input should be treated as a potential domain string.***
13
- * ----------------------------------------------------------
13
+ * -------------------------------------------------------------------------------------
14
14
  *
15
15
  * - Behavior when `true`:
16
- * - The `domainName` option is required and must be a string and non-empty string.
17
- * If `domainName` is `undefined`, `null`, or an empty string, a `TypeError` will be thrown.
18
- * - The `domainName` is used to determine if the input is a domain-only string.
19
- * - Returns `null` if the input exactly matches `domainName` or any of its subdomains **and** has no additional path or filename.
20
- * - If the input does not match `domainName` or its subdomains, it will be processed as a regular file-like name.
21
- * - Supports **Unicode/IDN domains** (e.g., `tést-ドメイン.com`) and **ASCII filenames**, mixed safely.
16
+ * - The `domainName` option is required and must be a string and non-empty string.
17
+ * If `domainName` is `undefined`, `null`, or an empty string, a `TypeError` will be thrown.
18
+ * - The `domainName` is used to determine if the input is a domain-only string.
19
+ * - Returns `null` if the input exactly matches `domainName` or any of its subdomains **and** has no additional path or filename.
20
+ * - If the input does not match `domainName` or its subdomains, it will be processed as a regular file-like name.
21
+ * - Supports **Unicode/IDN domains** (e.g., `tést-ドメイン.com`) and **ASCII filenames**, mixed safely.
22
22
  *
23
+ * ---
23
24
  * @default false
24
25
  */
25
26
  domainAware?: boolean;
26
- /** ----------------------------------------------------------
27
+ /** ------------------------------------------------------------------------------------
27
28
  * * ***The base domain name used for comparison (e.g., `"example.com"`).***
28
- * ----------------------------------------------------------
29
+ * -------------------------------------------------------------------------------------
29
30
  *
30
31
  * - Required when `domainAware` is `true`.
31
- * - Helps differentiate between a domain-only input (ignored) and a standalone file-like string (processed normally).
32
- * - Must be a string and non-empty string. Invalid values (`undefined`, `null`, or empty string) will trigger a `TypeError`.
33
- * - Works with both **ASCII domains** and **Unicode/IDN domains**.
34
- * - Example:
35
- * ```ts *
36
- * // ASCII domain + ASCII filename
37
- * extractFileName("resume.com", {
38
- * domainAware: true,
39
- * domainName: "example.com"
40
- * });
41
- * // ➔ "resume"
42
- * extractFileName("example.com", {
43
- * domainAware: true,
44
- * domainName: "example.com"
45
- * });
46
- * // ➔ null (because input is treated as domain-name)
32
+ * - Helps differentiate between a domain-only input (ignored) and a standalone file-like string (processed normally).
33
+ * - Must be a string and non-empty string. Invalid values (`undefined`, `null`, or empty string) will trigger a `TypeError`.
34
+ * - Works with both **ASCII domains** and **Unicode/IDN domains**.
35
+ * - Example:
36
+ * ```ts
37
+ * // ASCII domain + ASCII filename
38
+ * extractFileName("resume.com", {
39
+ * domainAware: true,
40
+ * domainName: "example.com"
41
+ * });
42
+ * // ➔ "resume"
43
+ * extractFileName("example.com", {
44
+ * domainAware: true,
45
+ * domainName: "example.com"
46
+ * });
47
+ * // ➔ null (because input is treated as domain-name)
47
48
  *
48
- * // Unicode domain + ASCII filename
49
- * extractFileName("tést-ドメイン.com/file.txt", {
50
- * domainAware: true,
51
- * domainName: "ドメイン.com"
52
- * });
53
- * // ➔ "file"
49
+ * // Unicode domain + ASCII filename
50
+ * extractFileName("tést-ドメイン.com/file.txt", {
51
+ * domainAware: true,
52
+ * domainName: "ドメイン.com"
53
+ * });
54
+ * // ➔ "file"
54
55
  *
55
- * // Unicode domain + Unicode filename
56
- * extractFileName("tést-ドメイン.com/ファイル名.pdf", {
57
- * domainAware: true,
58
- * domainName: "ドメイン.com"
59
- * });
60
- * // ➔ "ファイル名"
56
+ * // Unicode domain + Unicode filename
57
+ * extractFileName("tést-ドメイン.com/ファイル名.pdf", {
58
+ * domainAware: true,
59
+ * domainName: "ドメイン.com"
60
+ * });
61
+ * // ➔ "ファイル名"
61
62
  *
62
- * // Invalid domainName, will throw TypeError
63
- * extractFileName("resume.com", {
64
- * domainAware: true,
65
- * domainName: ""
66
- * });
67
- * // ➔ TypeError
68
- * ```
63
+ * // Invalid domainName, will throw TypeError
64
+ * extractFileName("resume.com", {
65
+ * domainAware: true,
66
+ * domainName: ""
67
+ * });
68
+ * // ➔ TypeError
69
+ * ```
69
70
  *
71
+ * ---
70
72
  * @default undefined
71
73
  */
72
74
  domainName?: string;
73
75
  };
74
- /** ----------------------------------------------------------
76
+ /** ------------------------------------------------------------------------------------
75
77
  * * ***Utility: `extractFileName`.***
76
- * ----------------------------------------------------------
77
- *
78
+ * -------------------------------------------------------------------------------------
78
79
  * **Extracts the **clean base filename** from nearly any input string, including URLs, local file paths,
79
80
  * UNC paths, and plain filenames.**
80
81
  *
82
+ * ---
81
83
  * - It automatically safely handles extracts the **base file name** (without extension) from:
82
- * - File system paths (Windows, Unix, UNC)
83
- * - Protocols like http, https, ftp, file, mailto, or custom schemes
84
- * - Percent-encoded, Unicode, and emoji characters
85
- * - Dotfiles, reserved OS names, multi-part extensions
86
- * - Data URIs
87
- * - Optional domain-aware mode to ignore domain-only inputs
88
- * - Plain filenames
84
+ * - File system paths (Windows, Unix, UNC).
85
+ * - Protocols like http, https, ftp, file, mailto, or custom schemes.
86
+ * - Percent-encoded, Unicode, and emoji characters.
87
+ * - Dotfiles, reserved OS names, multi-part extensions.
88
+ * - Data URIs.
89
+ * - Optional domain-aware mode to ignore domain-only inputs.
90
+ * - Plain filenames.
89
91
  *
92
+ * ---
90
93
  * - Full support for:
91
- * - Unicode, emoji, percent-encoding
92
- * - Dotfiles (e.g., `.env`, `.gitignore`)
93
- * - Reserved/OS-protected filenames:
94
- * `CON`, `PRN`, `AUX`, `NUL`, `COM1`–`COM9`, `LPT1`–`LPT9`
95
- * - Known multi-part extensions:
96
- * `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.lz`, `.tar.zst`, `.min.js`, `.js.map`, `.log.gz`, `.sql.gz`,
97
- * `.backup.tar`, etc.
98
- * - Data URIs (`data:[mime];base64,...` ➔ payload string)
99
- * - Domain-aware mode (optional)
94
+ * - Unicode, emoji, percent-encoding.
95
+ * - Dotfiles (e.g., `.env`, `.gitignore`).
96
+ * - Reserved/OS-protected filenames:
97
+ * `CON`, `PRN`, `AUX`, `NUL`, `COM1`~`COM9`, `LPT1`~`LPT9`.
98
+ * - Known multi-part extensions:
99
+ * `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.lz`, `.tar.zst`, `.min.js`, `.js.map`, `.log.gz`, `.sql.gz`,
100
+ * `.backup.tar`, etc.
101
+ * - Data URIs (`data:[mime];base64,...` ➔ payload string).
102
+ * - Domain-aware mode (optional).
100
103
  *
101
- * ----------------------------------------------------------
104
+ * ---
102
105
  * - **Behavior / Features**
103
- * - Strips **known extensions**, including multi-part and common double/triple extensions.
104
- * - Leaves unknown/custom extensions intact.
105
- * - Preserves **dotfiles** as-is (leading dot preserved).
106
- * - Returns `null` if:
107
- * - input is `null`, `undefined`, or not a string
108
- * - input is empty, whitespace-only, or only slashes
109
- * - input represents a folder path (trailing slash/backslash, drive/folder only)
110
- * - input is a **domain-only string** in domain-aware mode
111
- * - Normalizes Windows-style backslashes (`\`) internally as `/`.
112
- * - Supports UNC paths, mixed slashes, and Windows drive letters safely.
113
- * - Handles URLs:
114
- * - Ignores query strings (`?v=1.2.3`) and hash fragments (`#section`)
115
- * - Decodes percent-encoded filenames (`my%20file.txt` ➔ `my file.txt`)
116
- * - Supports protocol-relative URLs (`//cdn.example.com/file.jpg`)
117
- * - Supports uncommon/custom protocols (`ftp://`, `file://`, `mailto:`, etc.)
118
- * - Handles **multiple dots**, **trailing dots**, **triple or more extensions**
119
- * - Supports filenames on mixed Unicode/ASCII domains:
120
- * - Domain names can include Unicode characters (IDN / punycode)
121
- * - Filenames may contain ASCII, Unicode, and emoji characters
122
- * - Works correctly when domain is Unicode and filename is ASCII, or vice versa
123
- * - Supports extremely long filenames safely (up to OS limits)
124
- * - Domain-aware mode (`domainAware: true` + `domainName`):
125
- * - Parameter `domainName` must be a string and non-empty string; otherwise a TypeError is thrown.
126
- * - Returns `null` if input equals `domainName` or any subdomain with no file path
127
- * - Extracts filename normally if path/file exists on domain or other domain
128
- * - Safe in Node.js and browsers
106
+ * - Strips **known extensions**, including multi-part and common double/triple extensions.
107
+ * - Leaves unknown/custom extensions intact.
108
+ * - Preserves **dotfiles** as-is (leading dot preserved).
109
+ * - Returns `null` if:
110
+ * - input is `null`, `undefined`, or not a string.
111
+ * - input is empty, whitespace-only, or only slashes.
112
+ * - input represents a folder path (trailing slash/backslash, drive/folder only).
113
+ * - input is a **domain-only string** in domain-aware mode.
114
+ * - Normalizes Windows-style backslashes (`\`) internally as `/`.
115
+ * - Supports UNC paths, mixed slashes, and Windows drive letters safely.
116
+ * - Handles URLs:
117
+ * - Ignores query strings (`?v=1.2.3`) and hash fragments (`#section`).
118
+ * - Decodes percent-encoded filenames (`my%20file.txt` ➔ `my file.txt`).
119
+ * - Supports protocol-relative URLs (`//cdn.example.com/file.jpg`).
120
+ * - Supports uncommon/custom protocols (`ftp://`, `file://`, `mailto:`, etc.).
121
+ * - Handles **multiple dots**, **trailing dots**, **triple or more extensions**.
122
+ * - Supports filenames on mixed Unicode/ASCII domains:
123
+ * - Domain names can include Unicode characters (IDN / punycode).
124
+ * - Filenames may contain ASCII, Unicode, and emoji characters.
125
+ * - Works correctly when domain is Unicode and filename is ASCII, or vice versa.
126
+ * - Supports extremely long filenames safely (up to OS limits).
127
+ * - Domain-aware mode (`domainAware: true` + `domainName`):
128
+ * - Parameter `domainName` must be a string and non-empty string; otherwise a TypeError is thrown.
129
+ * - Returns `null` if input equals `domainName` or any subdomain with no file path.
130
+ * - Extracts filename normally if path/file exists on domain or other domain.
131
+ * - Safe in Node.js and browsers.
129
132
  *
130
- * ----------------------------------------------------------
133
+ * ---
131
134
  * @param {string | null | undefined} input
132
135
  * URL, file path, or plain filename to extract from.
133
136
  *
134
137
  * @param {ExtractFileNameOptions} [options]
135
138
  * Optional configuration:
136
- * - `domainAware?: boolean` – treat input as a domain string. Requires `domainName` to be a string and non-empty string; otherwise, a TypeError is thrown.
137
- * - `domainName?: string` – base domain for comparison eg (`example.com`), required when `domainAware` is true.
139
+ * - `domainAware?: boolean` – Treat input as a domain string. Requires `domainName` to be a string and non-empty string; otherwise, a TypeError is thrown.
140
+ * - `domainName?: string` – Base domain for comparison eg (`example.com`), required when `domainAware` is true.
138
141
  *
142
+ * ---
139
143
  * @returns {string | null}
140
144
  * - Base filename without known extensions
141
145
  * - Original filename if extension unknown
142
146
  * - `null` for invalid inputs, folder paths, or domain-only strings
143
147
  *
144
- * ----------------------------------------------------------
148
+ * ---
145
149
  * @example
146
- * ```ts
147
- * // Basic files
148
- * extractFileName("document.pdf"); // ➔ "document"
149
- * extractFileName("/files/archive.tar.gz"); // ➔ "archive"
150
- * extractFileName("C:\\path\\file.txt"); // ➔ "file"
151
- * extractFileName(".env"); // ➔ ".env"
152
- * extractFileName("folder/"); // ➔ null
153
- *
154
- * // Not a file
155
- * extractFileName("not-file"); // ➔ null
156
- * extractFileName("not-file/"); // ➔ null
157
- * extractFileName("/not-file/"); // ➔ null
158
- * extractFileName("/not-file"); // ➔ null
159
- *
160
- * // URLs with queries, hashes, protocols
161
- * extractFileName("https://example.com/file.txt?ver=1"); // ➔ "file"
162
- * extractFileName("https://example.com/archive.tar.gz#part"); // ➔ "archive"
163
- * extractFileName("//cdn.example.com/image.png"); // "image"
164
- *
165
- *
166
- * // Special protocol handling
167
- * extractFileName("tel:+6212345678"); // ➔ "+6212345678"
168
- * extractFileName("sms:+6212345678"); // ➔ "+6212345678"
169
- * extractFileName("mailto:user@domain.com"); // ➔ "user@domain"
170
- * extractFileName("data:text/plain;base64,SGVsbG8="); // ➔ "SGVsbG8="
171
- * extractFileName("mailto:resume.com"); // ➔ "resume"
172
- * extractFileName("ftp://example.com/image.jpeg"); // "image"
173
- * extractFileName("ftp://files.example.com/app.min.js"); // ➔ "app.min"
174
- * extractFileName("file:///C:/path/to/document.pdf"); // ➔ "document"
175
- * extractFileName("custom-scheme://example.com/video.mp4"); // ➔ "video"
176
- *
177
- * // Unicode & emoji
178
- * extractFileName("emoji-😊.png"); // ➔ "emoji-😊"
179
- * extractFileName("🔥project.tar.gz"); // ➔ "🔥project"
180
- *
181
- * // Dotfiles
182
- * extractFileName(".gitignore"); // ".gitignore"
183
- * extractFileName("/path/.bashrc"); // ➔ ".bashrc"
184
- *
185
- * // Mixed Unicode domain and ASCII filename
186
- * extractFileName("https://tést-ドメイン.com/file.txt"); // ➔ "file"
187
- * extractFileName("https://example.com/ファイル名.pdf"); // ➔ "ファイル名"
188
- * extractFileName("https://ドメイン例.com/emoji-🔥.png"); // ➔ "emoji-🔥"
189
- *
190
- * // Reserved filenames
191
- * extractFileName("CON"); // ➔ "CON"
192
- * extractFileName("NUL.txt"); // ➔ "NUL"
193
- *
194
- * // Domain-aware mode
195
- * extractFileName("example.com", {
196
- * domainAware: true,
197
- * domainName: "example.com"
198
- * });
199
- * // ➔ null
200
- * extractFileName("cdn.example.com", {
201
- * domainAware: true,
202
- * domainName: "example.com"
203
- * });
204
- * // null
205
- * extractFileName("resume.com", {
206
- * domainAware: true,
207
- * domainName: "example.com"
208
- * });
209
- * // ➔ "resume"
210
- * extractFileName("https://example.com/file.txt", {
211
- * domainAware: true,
212
- * domainName: "example.com"
213
- * });
214
- * // ➔ "file"
215
- *
216
- * // Windows & UNC paths
217
- * extractFileName("C:\\Users\\rzl\\Documents\\file.txt"); // ➔ "file"
218
- * extractFileName("\\\\SERVER\\share\\logs\\output.log"); // ➔ "output"
219
- * extractFileName("C:/Users\\rzl/mix\\test.pdf"); // "test"
220
- *
221
- * // Edge / extreme cases
222
- * extractFileName("https://example.com/my%20file%20name.txt"); // ➔ "my file name"
223
- * extractFileName("app.min.js.map"); // ➔ "app.min"
224
- * extractFileName("backup.tar.bak"); // ➔ "backup.tar.bak" (unknown double extension)
225
- * extractFileName("filename."); // ➔ "filename."
226
- * extractFileName("a".repeat(255) + ".txt"); // ➔ "a".repeat(255)
227
- * ```
228
- *
229
- * ----------------------------------------------------------
150
+ * 1. #### Basic files:
151
+ * ```ts
152
+ * extractFileName("document.pdf");
153
+ * // ➔ "document"
154
+ * extractFileName("/files/archive.tar.gz");
155
+ * // ➔ "archive"
156
+ * extractFileName("C:\\path\\file.txt");
157
+ * // ➔ "file"
158
+ * extractFileName(".env");
159
+ * // ➔ ".env"
160
+ * extractFileName("folder/");
161
+ * // ➔ null
162
+ * ```
163
+ * ---
164
+ * 2. #### Not a file:
165
+ * ```ts
166
+ * extractFileName("not-file");
167
+ * // ➔ null
168
+ * extractFileName("not-file/");
169
+ * // ➔ null
170
+ * extractFileName("/not-file/");
171
+ * // ➔ null
172
+ * extractFileName("/not-file");
173
+ * // ➔ null
174
+ * ```
175
+ * ---
176
+ * 3. #### URLs with `queries`, `hashes`, `protocols`:
177
+ * ```ts
178
+ * extractFileName("https://example.com/file.txt?ver=1");
179
+ * // ➔ "file"
180
+ * extractFileName("https://example.com/archive.tar.gz#part");
181
+ * // "archive"
182
+ * extractFileName("//cdn.example.com/image.png");
183
+ * // ➔ "image"
184
+ * ```
185
+ * ---
186
+ * 4. #### Special protocol handling:
187
+ * ```ts
188
+ * extractFileName("tel:+6212345678");
189
+ * // "+6212345678"
190
+ * extractFileName("sms:+6212345678");
191
+ * // ➔ "+6212345678"
192
+ * extractFileName("mailto:user@domain.com");
193
+ * // ➔ "user@domain"
194
+ * extractFileName("data:text/plain;base64,SGVsbG8=");
195
+ * // ➔ "SGVsbG8="
196
+ * extractFileName("mailto:resume.com");
197
+ * // ➔ "resume"
198
+ * extractFileName("ftp://example.com/image.jpeg");
199
+ * // "image"
200
+ * extractFileName("ftp://files.example.com/app.min.js");
201
+ * // "app.min"
202
+ * extractFileName("file:///C:/path/to/document.pdf");
203
+ * // ➔ "document"
204
+ * extractFileName("custom-scheme://example.com/video.mp4");
205
+ * // ➔ "video"
206
+ * ```
207
+ * ---
208
+ * 5. #### Unicode & emoji:
209
+ * ```ts
210
+ * extractFileName("emoji-😊.png");
211
+ * // "emoji-😊"
212
+ * extractFileName("🔥project.tar.gz");
213
+ * // ➔ "🔥project"
214
+ * ```
215
+ * 6. #### Dotfiles:
216
+ * ```ts
217
+ * extractFileName(".gitignore");
218
+ * // ➔ ".gitignore"
219
+ * extractFileName("/path/.bashrc");
220
+ * // ".bashrc"
221
+ * ```
222
+ * ---
223
+ * 7. #### Mixed Unicode domain and ASCII filename:
224
+ * ```ts
225
+ * extractFileName("https://tést-ドメイン.com/file.txt");
226
+ * // ➔ "file"
227
+ * extractFileName("https://example.com/ファイル名.pdf");
228
+ * // ➔ "ファイル名"
229
+ * extractFileName("https://ドメイン例.com/emoji-🔥.png");
230
+ * // ➔ "emoji-🔥"
231
+ * ```
232
+ * 8. #### Reserved filenames:
233
+ * ```ts
234
+ * extractFileName("CON");
235
+ * // ➔ "CON"
236
+ * extractFileName("NUL.txt");
237
+ * // ➔ "NUL"
238
+ * ```
239
+ * ---
240
+ * 9. #### Domain-aware mode:
241
+ * ```ts
242
+ * extractFileName("example.com", {
243
+ * domainAware: true,
244
+ * domainName: "example.com"
245
+ * });
246
+ * // ➔ null
247
+ * extractFileName("cdn.example.com", {
248
+ * domainAware: true,
249
+ * domainName: "example.com"
250
+ * });
251
+ * // ➔ null
252
+ * extractFileName("resume.com", {
253
+ * domainAware: true,
254
+ * domainName: "example.com"
255
+ * });
256
+ * // ➔ "resume"
257
+ * extractFileName("https://example.com/file.txt", {
258
+ * domainAware: true,
259
+ * domainName: "example.com"
260
+ * });
261
+ * // ➔ "file"
262
+ * ```
263
+ * ---
264
+ * 10. #### Windows & UNC paths:
265
+ * ```ts
266
+ * extractFileName("C:\\Users\\rzl\\Documents\\file.txt");
267
+ * // ➔ "file"
268
+ * extractFileName("\\\\SERVER\\share\\logs\\output.log");
269
+ * // ➔ "output"
270
+ * extractFileName("C:/Users\\rzl/mix\\test.pdf");
271
+ * // ➔ "test"
272
+ * ```
273
+ * ---
274
+ * 11. #### Edge / extreme cases:
275
+ * ```ts
276
+ * extractFileName("https://example.com/my%20file%20name.txt");
277
+ * // ➔ "my file name"
278
+ * extractFileName("app.min.js.map");
279
+ * // ➔ "app.min"
280
+ * extractFileName("backup.tar.bak");
281
+ * // ➔ "backup.tar.bak" (unknown double extension)
282
+ * extractFileName("filename.");
283
+ * // ➔ "filename."
284
+ * extractFileName("a".repeat(255) + ".txt");
285
+ * // ➔ "a".repeat(255)
286
+ * ```
287
+ * ---
230
288
  * @note
231
289
  * - Robust: never throws, handles unusual inputs safely.
232
290
  * - Suitable for display, logging, or safe storage.
@@ -2,10 +2,10 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1-beta.0`
5
+ * Version: `3.14.0-beta.0`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
9
9
  */
10
- import { t as extractFileName } from "../parsers-BLHzVoh-.js";
10
+ import { t as extractFileName } from "../parsers-BBAE_xVM.js";
11
11
  export { extractFileName };
@@ -2,13 +2,13 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/utils-js
4
4
  * ------------------------------------------------------------------------
5
- * Version: `3.13.1-beta.0`
5
+ * Version: `3.14.0-beta.0`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
8
  * ========================================================================
9
9
  */
10
- import { T as assertIsPlainObject, t as assertIsBoolean, y as isNonEmptyString } from "./assertIsBoolean-DDhQ2D-k.js";
11
- import { t as punycodeUtilsJS } from "./punyCode-COTqgXMJ.js";
10
+ import { E as isPlainObject, n as assertIsBoolean, t as createMessage, w as isNonEmptyString } from "./logger-CLWnKRKE.js";
11
+ import { t as punycodeUtilsJS } from "./punyCode-Deb1Mrkc.js";
12
12
  const EXTENSIONS_FILE = new Set([
13
13
  "txt",
14
14
  "md",
@@ -564,15 +564,15 @@ const SPECIAL_FILENAMES = new Set([
564
564
  "LPT8",
565
565
  "LPT9"
566
566
  ]);
567
- const extractFileName = (input, options = {}) => {
567
+ const extractFileName = (input, options) => {
568
568
  if (!isNonEmptyString(input)) return null;
569
- assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
569
+ if (!isPlainObject(options)) options = {};
570
570
  const { domainName, domainAware = false } = options;
571
- assertIsBoolean(domainAware, { message: ({ currentType, validType }) => `Parameter \`domainAware\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
571
+ assertIsBoolean(domainAware, { message: ({ currentType, validType }) => errorMsg(`Parameter \`domainAware\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`) });
572
572
  let pathname = input.trim();
573
573
  pathname = pathname.replace(/\\/g, "/");
574
574
  if (domainAware) {
575
- if (!isNonEmptyString(domainName)) throw new TypeError("If parameter `domainAware` is set to `true`, the option parameter `domainName` is required as string, and cant be an empty-string.");
575
+ if (!isNonEmptyString(domainName)) throw new TypeError(errorMsg("If parameter `domainAware` is set to `true`, the option parameter `domainName` is required as string, and cant be an empty-string."));
576
576
  const cleanDomain = punycodeUtilsJS.toASCII(domainName).replace(/^https?:\/\//i, "").replace(/^www\./, "").replace(/\/.*$/, "").toLowerCase();
577
577
  const inputDomain = punycodeUtilsJS.toASCII(input).replace(/^https?:\/\//i, "").replace(/^www\./, "").toLowerCase();
578
578
  const inputHost = inputDomain.split("/")[0]?.split(/[?#]/)[0];
@@ -639,5 +639,6 @@ const extractFileName = (input, options = {}) => {
639
639
  }
640
640
  return filename || null;
641
641
  };
642
+ const errorMsg = (msg) => createMessage("extractFileName", msg);
642
643
  export { extractFileName as t };
643
- //# sourceMappingURL=parsers-BLHzVoh-.js.map
644
+ //# sourceMappingURL=parsers-BBAE_xVM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-BBAE_xVM.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 { createMessage } from \"@/_private/logger\";\n\nimport { punycodeUtilsJS } from \"@/urls/utils/punyCode\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\n\nimport {\n DOUBLE_EXTENSIONS_FILE,\n EXTENSIONS_FILE,\n SPECIAL_FILENAMES\n} from \"./_private/extensions\";\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 * ---\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 * ---\n * @default undefined\n */\n domainName?: string;\n};\n\n/** ------------------------------------------------------------------------------------\n * * ***Utility: `extractFileName`.***\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 * ---\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 * ---\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 * ---\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 * 1. #### Basic files:\n * ```ts\n * extractFileName(\"document.pdf\");\n * // ➔ \"document\"\n * extractFileName(\"/files/archive.tar.gz\");\n * // ➔ \"archive\"\n * extractFileName(\"C:\\\\path\\\\file.txt\");\n * // ➔ \"file\"\n * extractFileName(\".env\");\n * // ➔ \".env\"\n * extractFileName(\"folder/\");\n * // ➔ null\n * ```\n * ---\n * 2. #### Not a file:\n * ```ts\n * extractFileName(\"not-file\");\n * // ➔ null\n * extractFileName(\"not-file/\");\n * // ➔ null\n * extractFileName(\"/not-file/\");\n * // ➔ null\n * extractFileName(\"/not-file\");\n * // ➔ null\n * ```\n * ---\n * 3. #### URLs with `queries`, `hashes`, `protocols`:\n * ```ts\n * extractFileName(\"https://example.com/file.txt?ver=1\");\n * // ➔ \"file\"\n * extractFileName(\"https://example.com/archive.tar.gz#part\");\n * // ➔ \"archive\"\n * extractFileName(\"//cdn.example.com/image.png\");\n * // ➔ \"image\"\n * ```\n * ---\n * 4. #### Special protocol handling:\n * ```ts\n * extractFileName(\"tel:+6212345678\");\n * // ➔ \"+6212345678\"\n * extractFileName(\"sms:+6212345678\");\n * // ➔ \"+6212345678\"\n * extractFileName(\"mailto:user@domain.com\");\n * // ➔ \"user@domain\"\n * extractFileName(\"data:text/plain;base64,SGVsbG8=\");\n * // ➔ \"SGVsbG8=\"\n * extractFileName(\"mailto:resume.com\");\n * // ➔ \"resume\"\n * extractFileName(\"ftp://example.com/image.jpeg\");\n * // ➔ \"image\"\n * extractFileName(\"ftp://files.example.com/app.min.js\");\n * // ➔ \"app.min\"\n * extractFileName(\"file:///C:/path/to/document.pdf\");\n * // ➔ \"document\"\n * extractFileName(\"custom-scheme://example.com/video.mp4\");\n * // ➔ \"video\"\n * ```\n * ---\n * 5. #### Unicode & emoji:\n * ```ts\n * extractFileName(\"emoji-😊.png\");\n * // ➔ \"emoji-😊\"\n * extractFileName(\"🔥project.tar.gz\");\n * // ➔ \"🔥project\"\n * ```\n * 6. #### Dotfiles:\n * ```ts\n * extractFileName(\".gitignore\");\n * // ➔ \".gitignore\"\n * extractFileName(\"/path/.bashrc\");\n * // ➔ \".bashrc\"\n * ```\n * ---\n * 7. #### Mixed Unicode domain and ASCII filename:\n * ```ts\n * extractFileName(\"https://tést-ドメイン.com/file.txt\");\n * // ➔ \"file\"\n * extractFileName(\"https://example.com/ファイル名.pdf\");\n * // ➔ \"ファイル名\"\n * extractFileName(\"https://ドメイン例.com/emoji-🔥.png\");\n * // ➔ \"emoji-🔥\"\n * ```\n * 8. #### Reserved filenames:\n * ```ts\n * extractFileName(\"CON\");\n * // ➔ \"CON\"\n * extractFileName(\"NUL.txt\");\n * // ➔ \"NUL\"\n * ```\n * ---\n * 9. #### Domain-aware mode:\n * ```ts\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 * ---\n * 10. #### Windows & UNC paths:\n * ```ts\n * extractFileName(\"C:\\\\Users\\\\rzl\\\\Documents\\\\file.txt\");\n * // ➔ \"file\"\n * extractFileName(\"\\\\\\\\SERVER\\\\share\\\\logs\\\\output.log\");\n * // ➔ \"output\"\n * extractFileName(\"C:/Users\\\\rzl/mix\\\\test.pdf\");\n * // ➔ \"test\"\n * ```\n * ---\n * 11. #### Edge / extreme cases:\n * ```ts\n * extractFileName(\"https://example.com/my%20file%20name.txt\");\n * // ➔ \"my file name\"\n * extractFileName(\"app.min.js.map\");\n * // ➔ \"app.min\"\n * extractFileName(\"backup.tar.bak\");\n * // ➔ \"backup.tar.bak\" (unknown double extension)\n * extractFileName(\"filename.\");\n * // ➔ \"filename.\"\n * extractFileName(\"a\".repeat(255) + \".txt\");\n * // ➔ \"a\".repeat(255)\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 if (!isPlainObject(options)) options = {};\n\n const { domainName, domainAware = false } = options;\n\n assertIsBoolean(domainAware, {\n message: ({ currentType, validType }) =>\n errorMsg(\n `Parameter \\`domainAware\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n )\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 errorMsg(\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\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\n/**\n * @internal ***`Not part of the public API.`***\n */\nconst errorMsg = (msg: string) => createMessage(\"extractFileName\", msg);\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;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"}