@rzl-zone/utils-js 3.8.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +5 -1
  2. package/dist/assertions/index.cjs +11 -11
  3. package/dist/assertions/index.d.ts +168 -57
  4. package/dist/assertions/index.js +5 -5
  5. package/dist/{chunk-EK7FSI7F.cjs → chunk-2XGQQZ6A.cjs} +3 -3
  6. package/dist/{chunk-YS27V6LS.js → chunk-3LE6NX57.js} +5 -176
  7. package/dist/{chunk-PZQC3FZY.js → chunk-44X74C26.js} +4 -4
  8. package/dist/{chunk-4ACKNPL5.js → chunk-5KDVIEVO.js} +2 -2
  9. package/dist/{chunk-JY4HLZ4W.js → chunk-5O66AUEC.js} +2 -2
  10. package/dist/{chunk-SLP24LUV.js → chunk-5Y6JL47L.js} +3 -3
  11. package/dist/{chunk-ZW3VYES4.cjs → chunk-62FS7WMB.cjs} +31 -31
  12. package/dist/{chunk-VJVCXEH7.cjs → chunk-6AMDHVS2.cjs} +9 -181
  13. package/dist/{chunk-5IKZ3JDV.js → chunk-6WVOUVWD.js} +9 -9
  14. package/dist/{chunk-BYUT376O.cjs → chunk-76ATVDCR.cjs} +3 -3
  15. package/dist/{chunk-F3WBQKRI.cjs → chunk-7C7TQC5J.cjs} +29 -7
  16. package/dist/{chunk-I3IXLEEG.js → chunk-7EIFPHV3.js} +8 -8
  17. package/dist/{chunk-6RFNZ2ZZ.cjs → chunk-7NXFGJJE.cjs} +14 -14
  18. package/dist/{chunk-TFDXRT6D.cjs → chunk-ALRISPTL.cjs} +3 -3
  19. package/dist/chunk-BAV5T2E3.cjs +1 -1
  20. package/dist/{chunk-4ZOXSUXB.js → chunk-C7GC2PFX.js} +3 -3
  21. package/dist/chunk-DVMHRLKP.cjs +1 -1
  22. package/dist/{chunk-KVZ3HL2B.js → chunk-DXPM4NOU.js} +4 -4
  23. package/dist/{chunk-DPLL67OT.js → chunk-EJV5AF4L.js} +2 -2
  24. package/dist/{chunk-NREACG6M.cjs → chunk-FWWPEL7J.cjs} +3 -3
  25. package/dist/{chunk-LEX4TQW2.js → chunk-GHU356XQ.js} +4 -6
  26. package/dist/chunk-GKDSBOYE.js +209 -0
  27. package/dist/{chunk-YC7AK3KX.cjs → chunk-H44QVAZL.cjs} +31 -31
  28. package/dist/{chunk-AKKM6MOX.cjs → chunk-I33PB44Q.cjs} +15 -15
  29. package/dist/{chunk-LIU4S3JA.cjs → chunk-IX6PF5ZP.cjs} +4 -4
  30. package/dist/{chunk-3KTD3QDI.js → chunk-J4TT33ZX.js} +29 -7
  31. package/dist/{chunk-SZJ7OI4S.js → chunk-J6VLFVIL.js} +3 -3
  32. package/dist/{chunk-3JD53UUH.cjs → chunk-JI57K7D4.cjs} +161 -161
  33. package/dist/{chunk-OFBFGFVH.js → chunk-JYOCB6OV.js} +2 -2
  34. package/dist/chunk-KHO2SBNA.cjs +1 -1
  35. package/dist/{chunk-6NORJBI6.cjs → chunk-KUVRZ2JW.cjs} +50 -50
  36. package/dist/chunk-L5RDAVVH.js +1 -1
  37. package/dist/{chunk-VCVND6CH.js → chunk-M5QB2GM5.js} +2 -2
  38. package/dist/{chunk-RRJIRXHS.js → chunk-MBFVTGYS.js} +4 -4
  39. package/dist/{chunk-UKAUXY2U.cjs → chunk-MMRHKYT6.cjs} +12 -12
  40. package/dist/{chunk-U5VR4TJN.js → chunk-MS2KSKD7.js} +9 -9
  41. package/dist/{chunk-7ZNEUWYP.js → chunk-MZ3T6L7Z.js} +2 -2
  42. package/dist/{chunk-ATLFMKAF.cjs → chunk-NAOVH4OH.cjs} +7 -7
  43. package/dist/{chunk-HKJZ7K2K.cjs → chunk-NJ24M6ZH.cjs} +37 -37
  44. package/dist/chunk-OCTHWEZK.cjs +249 -0
  45. package/dist/chunk-ONZFBJVW.js +1 -1
  46. package/dist/{chunk-FI76UZRF.js → chunk-OSSFLQDD.js} +3 -4
  47. package/dist/{chunk-7WBMA2VE.cjs → chunk-OYFUBKEG.cjs} +4 -5
  48. package/dist/{chunk-B4SDEBN7.cjs → chunk-PWKOFPAH.cjs} +3 -3
  49. package/dist/{chunk-RJYWBVGD.cjs → chunk-QGTFQ7RO.cjs} +6 -6
  50. package/dist/chunk-QNKGP5DY.js +1 -1
  51. package/dist/chunk-QXTJVDWE.js +676 -0
  52. package/dist/{chunk-B6UIKBHR.cjs → chunk-QZI5PVCI.cjs} +4 -4
  53. package/dist/{chunk-PW2VMJLT.js → chunk-R2DR7SPJ.js} +99 -25
  54. package/dist/{chunk-TDYGYHSH.js → chunk-SN5HAK3Y.js} +4 -4
  55. package/dist/{chunk-P3ST4UZA.js → chunk-SRWL4YCP.js} +7 -7
  56. package/dist/{chunk-7QQV66RX.cjs → chunk-TJ5OY6MC.cjs} +10 -10
  57. package/dist/{chunk-6WMB5AJR.js → chunk-TXOVQZPU.js} +3 -4
  58. package/dist/chunk-UDA26MCU.cjs +1 -1
  59. package/dist/{chunk-LVFTN6DK.cjs → chunk-UFYMRRJH.cjs} +61 -61
  60. package/dist/{chunk-5NN4ZDE2.cjs → chunk-UV5BKAYW.cjs} +6 -8
  61. package/dist/{chunk-GAJBF6DR.js → chunk-UXT4XSUK.js} +2 -2
  62. package/dist/{chunk-6VA4F6VR.js → chunk-VBSLIIDB.js} +10 -10
  63. package/dist/chunk-VCYXNIZ2.cjs +678 -0
  64. package/dist/chunk-VJDDGRIK.cjs +1 -1
  65. package/dist/{chunk-JIROTDOU.js → chunk-WB3FT62A.js} +3 -3
  66. package/dist/{chunk-K63WO3XA.cjs → chunk-WKM6UVMG.cjs} +4 -5
  67. package/dist/{chunk-5PF7KRCP.cjs → chunk-WLEZ2KSG.cjs} +126 -126
  68. package/dist/{chunk-ZN53RM3R.js → chunk-WRGN6UBK.js} +2 -2
  69. package/dist/chunk-WVSPXFTY.js +1 -1
  70. package/dist/{chunk-2VO2CBTU.js → chunk-X6ULJZ3X.js} +2 -2
  71. package/dist/{chunk-CKUEZF4R.cjs → chunk-XYWC4EQ3.cjs} +71 -71
  72. package/dist/{chunk-A3YI6Y2P.js → chunk-YHFRCVTN.js} +3 -3
  73. package/dist/{chunk-A4H7474O.cjs → chunk-YQHJB7KR.cjs} +26 -26
  74. package/dist/{chunk-YGB2BQPB.cjs → chunk-YVRUY4EW.cjs} +8 -8
  75. package/dist/chunk-YWHHVDT4.js +1 -1
  76. package/dist/chunk-ZTHJQJ5F.cjs +211 -0
  77. package/dist/conversions/index.cjs +34 -34
  78. package/dist/conversions/index.d.ts +1 -1
  79. package/dist/conversions/index.js +15 -15
  80. package/dist/events/index.cjs +8 -8
  81. package/dist/events/index.d.ts +1 -1
  82. package/dist/events/index.js +4 -4
  83. package/dist/formatters/index.cjs +19 -19
  84. package/dist/formatters/index.d.ts +1 -1
  85. package/dist/formatters/index.js +9 -9
  86. package/dist/generators/index.cjs +9 -9
  87. package/dist/generators/index.d.ts +1 -1
  88. package/dist/generators/index.js +4 -4
  89. package/dist/index.d.ts +1 -1
  90. package/dist/isPlainObject-BTPjv6zB.d.ts +1 -1
  91. package/dist/next/index.cjs +37 -36
  92. package/dist/next/index.d.ts +1 -1
  93. package/dist/next/index.js +9 -8
  94. package/dist/next/server/index.cjs +4 -4
  95. package/dist/next/server/index.d.ts +1 -1
  96. package/dist/next/server/index.js +2 -2
  97. package/dist/operations/index.cjs +11 -11
  98. package/dist/operations/index.d.ts +1 -1
  99. package/dist/operations/index.js +8 -8
  100. package/dist/parsers/index.cjs +6 -4
  101. package/dist/parsers/index.d.ts +224 -32
  102. package/dist/parsers/index.js +5 -3
  103. package/dist/predicates/index.cjs +77 -76
  104. package/dist/predicates/index.d.ts +1 -1
  105. package/dist/predicates/index.js +14 -13
  106. package/dist/promises/index.cjs +6 -6
  107. package/dist/promises/index.d.ts +2 -3
  108. package/dist/promises/index.js +4 -4
  109. package/dist/rzl-utils.global.js +2 -2
  110. package/dist/strings/index.cjs +23 -23
  111. package/dist/strings/index.d.ts +1 -1
  112. package/dist/strings/index.js +7 -7
  113. package/dist/tailwind/index.cjs +13 -13
  114. package/dist/tailwind/index.d.ts +1 -1
  115. package/dist/tailwind/index.js +5 -5
  116. package/dist/urls/index.cjs +23 -21
  117. package/dist/urls/index.d.ts +182 -114
  118. package/dist/urls/index.js +16 -14
  119. package/package.json +1 -1
  120. package/dist/chunk-KPCDDYTZ.js +0 -417
  121. package/dist/chunk-QAPYHLHC.cjs +0 -419
  122. package/dist/chunk-SGCN4ED4.cjs +0 -175
@@ -0,0 +1,676 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.9.1.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
10
+ import { punycodeUtilsJS } from './chunk-GKDSBOYE.js';
11
+ import { isNonEmptyString, assertIsPlainObject, assertIsBoolean } from './chunk-J4TT33ZX.js';
12
+
13
+ var EXTENSIONS_FILE = /* @__PURE__ */ new Set([
14
+ // 📄 Text & Document
15
+ "txt",
16
+ "md",
17
+ "rtf",
18
+ "tex",
19
+ "doc",
20
+ "docx",
21
+ "odt",
22
+ "ott",
23
+ "pdf",
24
+ "djvu",
25
+ "epub",
26
+ "fb2",
27
+ "lit",
28
+ "lrf",
29
+ "xls",
30
+ "xlsx",
31
+ "ods",
32
+ "csv",
33
+ "tsv",
34
+ "ppt",
35
+ "pptx",
36
+ "pps",
37
+ "bib",
38
+ "cba",
39
+ "cbt",
40
+ "cbz",
41
+ "cbr",
42
+ "opds",
43
+ "fodt",
44
+ "pages",
45
+ "rtfd",
46
+ "sxc",
47
+ "sxw",
48
+ "wpd",
49
+ "xps",
50
+ "dotx",
51
+ "dotm",
52
+ "xltx",
53
+ "xltm",
54
+ "sldx",
55
+ "sldm",
56
+ "fods",
57
+ "mdx",
58
+ "markdown",
59
+ "texi",
60
+ "textile",
61
+ // 🖼️ Image
62
+ "jpg",
63
+ "jpeg",
64
+ "png",
65
+ "gif",
66
+ "bmp",
67
+ "tif",
68
+ "tiff",
69
+ "webp",
70
+ "svg",
71
+ "ico",
72
+ "heif",
73
+ "heic",
74
+ "raw",
75
+ "cr2",
76
+ "nef",
77
+ "orf",
78
+ "sr2",
79
+ "dng",
80
+ "dds",
81
+ "psd",
82
+ "exr",
83
+ "xcf",
84
+ "ai",
85
+ "eps",
86
+ "cdr",
87
+ "indd",
88
+ "pcx",
89
+ "pgm",
90
+ "ppm",
91
+ "pbm",
92
+ "pnm",
93
+ "jfif",
94
+ "ras",
95
+ "tga",
96
+ "j2k",
97
+ "jp2",
98
+ "emf",
99
+ "wmf",
100
+ "hdp",
101
+ "mdi",
102
+ "hevc",
103
+ // 🎵 Audio
104
+ "mp3",
105
+ "wav",
106
+ "ogg",
107
+ "flac",
108
+ "aac",
109
+ "m4a",
110
+ "wma",
111
+ "alac",
112
+ "aiff",
113
+ "aif",
114
+ "amr",
115
+ "mid",
116
+ "midi",
117
+ "opus",
118
+ "au",
119
+ "caf",
120
+ "ape",
121
+ "mka",
122
+ "spx",
123
+ "ra",
124
+ "ram",
125
+ "mpc",
126
+ "wv",
127
+ "aifc",
128
+ "mod",
129
+ "it",
130
+ "s3m",
131
+ "xm",
132
+ "kar",
133
+ "m4b",
134
+ "voc",
135
+ "snd",
136
+ "a52",
137
+ "ac3",
138
+ "dts",
139
+ // 🎥 Video
140
+ "mp4",
141
+ "mkv",
142
+ "avi",
143
+ "mov",
144
+ "wmv",
145
+ "webm",
146
+ "mpeg",
147
+ "mpg",
148
+ "3gp",
149
+ "3g2",
150
+ "m4v",
151
+ "ts",
152
+ "mts",
153
+ "asf",
154
+ "rm",
155
+ "rmvb",
156
+ "vob",
157
+ "f4v",
158
+ "ogv",
159
+ "m2ts",
160
+ "dav",
161
+ "mxf",
162
+ "mjpeg",
163
+ "flv",
164
+ "divx",
165
+ "f4a",
166
+ "f4p",
167
+ "m2v",
168
+ "ogm",
169
+ "vp8",
170
+ "vp9",
171
+ "xvid",
172
+ "yuv",
173
+ "mng",
174
+ "dv",
175
+ "m1v",
176
+ "roq",
177
+ "m2t",
178
+ "av1",
179
+ "hevc",
180
+ "m3u",
181
+ "m3u8",
182
+ // 🗃️ Archive & Compression
183
+ "zip",
184
+ "rar",
185
+ "7z",
186
+ "tar",
187
+ "gz",
188
+ "bz",
189
+ "bz2",
190
+ "xz",
191
+ "tgz",
192
+ "tbz2",
193
+ "txz",
194
+ "lz",
195
+ "lzma",
196
+ "z",
197
+ "cab",
198
+ "arj",
199
+ "ace",
200
+ "rpm",
201
+ "deb",
202
+ "pkg",
203
+ "apk",
204
+ "jar",
205
+ "war",
206
+ "ear",
207
+ "sit",
208
+ "sitx",
209
+ "cpgz",
210
+ "tlz",
211
+ "tlzma",
212
+ "tzo",
213
+ "cpio",
214
+ "shar",
215
+ "bzip",
216
+ "gzip",
217
+ "7zip",
218
+ "rar5",
219
+ "tbz",
220
+ "txz",
221
+ // 💾 Disk Image
222
+ "iso",
223
+ "img",
224
+ "vhd",
225
+ "vmdk",
226
+ "qcow2",
227
+ "vhdx",
228
+ "bin",
229
+ "cue",
230
+ "nrg",
231
+ "daa",
232
+ "sdi",
233
+ "vfd",
234
+ "ima",
235
+ "dmg",
236
+ "vdi",
237
+ "toast",
238
+ "ccd",
239
+ "mdf",
240
+ "cdi",
241
+ "bif",
242
+ "bifc",
243
+ "bifd",
244
+ // 🗃️ Database & Data
245
+ "sql",
246
+ "db",
247
+ "dbf",
248
+ "mdb",
249
+ "accdb",
250
+ "json",
251
+ "toml",
252
+ "ini",
253
+ "log",
254
+ "plist",
255
+ "pkl",
256
+ "msgpack",
257
+ "h5",
258
+ "hdf5",
259
+ "parquet",
260
+ "avro",
261
+ "orc",
262
+ "ndjson",
263
+ "pdb",
264
+ "sqlite",
265
+ "sqlite3",
266
+ "dbx",
267
+ "sdf",
268
+ "nc",
269
+ "netcdf",
270
+ "grib",
271
+ "geojson",
272
+ "gml",
273
+ "hjson",
274
+ "cdb",
275
+ "db3",
276
+ "dta",
277
+ "sav",
278
+ "sas7bdat",
279
+ "ldif",
280
+ "fdb",
281
+ "gdb",
282
+ "sqlite2",
283
+ "h5ad",
284
+ "nc4",
285
+ "xmind",
286
+ "drawio",
287
+ "sdc",
288
+ "jsonl",
289
+ "yaml",
290
+ "yml",
291
+ "toml",
292
+ // 💻 Code & Script
293
+ "js",
294
+ "jsx",
295
+ "ts",
296
+ "tsx",
297
+ "c",
298
+ "cpp",
299
+ "net",
300
+ "h",
301
+ "hpp",
302
+ "java",
303
+ "py",
304
+ "rb",
305
+ "go",
306
+ "rs",
307
+ "php",
308
+ "pl",
309
+ "sh",
310
+ "bat",
311
+ "cmd",
312
+ "ps1",
313
+ "lua",
314
+ "swift",
315
+ "kt",
316
+ "scala",
317
+ "cs",
318
+ "vb",
319
+ "dart",
320
+ "m",
321
+ "r",
322
+ "jl",
323
+ "fs",
324
+ "vbproj",
325
+ "sln",
326
+ "pri",
327
+ "gemspec",
328
+ "gradle",
329
+ "coffee",
330
+ "erl",
331
+ "ex",
332
+ "exs",
333
+ "hs",
334
+ "lisp",
335
+ "clj",
336
+ "groovy",
337
+ "scm",
338
+ "vbs",
339
+ "nim",
340
+ "rkt",
341
+ "ml",
342
+ "mli",
343
+ "fsx",
344
+ "psm1",
345
+ "cbl",
346
+ "for",
347
+ "f90",
348
+ "lock",
349
+ "tsconfig",
350
+ "vue",
351
+ "svelte",
352
+ "cjs",
353
+ "mjs",
354
+ "mts",
355
+ "cts",
356
+ "json5",
357
+ "es6",
358
+ "module",
359
+ "systemjs",
360
+ // 🌐 Web & Config
361
+ "html",
362
+ "htm",
363
+ "xhtml",
364
+ "css",
365
+ "scss",
366
+ "sass",
367
+ "less",
368
+ "xml",
369
+ "xlf",
370
+ "po",
371
+ "pot",
372
+ "jsp",
373
+ "asp",
374
+ "aspx",
375
+ "jspf",
376
+ "cgi",
377
+ "cfm",
378
+ "env",
379
+ "babelrc",
380
+ "cfg",
381
+ "config",
382
+ "conf",
383
+ "editorconfig",
384
+ "eslintrc",
385
+ "gitconfig",
386
+ "gitattributes",
387
+ "gitignore",
388
+ "prettierrc",
389
+ "webmanifest",
390
+ "dockerfile",
391
+ // ".dockerfile",
392
+ // 🔠 Font
393
+ "ttf",
394
+ "otf",
395
+ "woff",
396
+ "woff2",
397
+ "eot",
398
+ "dfont",
399
+ "pfa",
400
+ "pfb",
401
+ "fon",
402
+ "fnt",
403
+ "bdf",
404
+ "ps",
405
+ // 🗺️ CAD & GIS
406
+ "dwg",
407
+ "dxf",
408
+ "shp",
409
+ "kml",
410
+ "kmz",
411
+ "gpx",
412
+ "stl",
413
+ "step",
414
+ "iges",
415
+ "igs",
416
+ "3ds",
417
+ "3dm",
418
+ "fbx",
419
+ "obj",
420
+ "dae",
421
+ "ifc",
422
+ // 🔧 System / Binary / Execution
423
+ "exe",
424
+ "msi",
425
+ "run",
426
+ "com",
427
+ "app",
428
+ "elf",
429
+ "dll",
430
+ "so",
431
+ "dylib",
432
+ "sys",
433
+ "scr",
434
+ "bin",
435
+ "out",
436
+ // 🔐 Certificates / Crypto
437
+ "pem",
438
+ "crt",
439
+ "cer",
440
+ "der",
441
+ "csr",
442
+ "p12",
443
+ "pfx",
444
+ "jks",
445
+ "asc",
446
+ "gpg",
447
+ "pgp",
448
+ "p7b",
449
+ "p7c",
450
+ "spc",
451
+ "key",
452
+ "pub",
453
+ "cert",
454
+ "p7m",
455
+ // 🎮 Games & Projects
456
+ "nes",
457
+ "sfc",
458
+ "gba",
459
+ "nds",
460
+ "rom",
461
+ "pak",
462
+ "vpk",
463
+ "bik",
464
+ "cso",
465
+ "wad",
466
+ "wadx",
467
+ "smc",
468
+ "gb",
469
+ "gbc",
470
+ // 🔬 Bioinformatics
471
+ "fasta",
472
+ "fa",
473
+ "fas",
474
+ "ffn",
475
+ "faa",
476
+ "fna",
477
+ "frn",
478
+ "fastq",
479
+ "fq",
480
+ "bam",
481
+ "bed",
482
+ "sam",
483
+ "vcf",
484
+ "gff",
485
+ "gff3",
486
+ "gtf",
487
+ "fai",
488
+ "tbi",
489
+ "fast5",
490
+ "fqz",
491
+ "fq5"
492
+ ]);
493
+ var DOUBLE_EXTENSIONS_FILE = /* @__PURE__ */ new Set([
494
+ "log.gz",
495
+ "tar.gz",
496
+ "tar.bz2",
497
+ "tar.bz",
498
+ "tar.xz",
499
+ "tar.lz",
500
+ "tar.lzma",
501
+ "tar.Z",
502
+ "tar.zst",
503
+ "tar.lz4",
504
+ "log.gz",
505
+ "sql.gz",
506
+ "csv.gz",
507
+ "tsv.gz",
508
+ "json.gz",
509
+ "ndjson.gz",
510
+ "fq.gz",
511
+ "sam.gz",
512
+ "fasta.gz",
513
+ "fa.gz",
514
+ "ffn.gz",
515
+ "faa.gz",
516
+ "fna.gz",
517
+ "frn.gz",
518
+ "fastq.gz",
519
+ "js.map",
520
+ "css.map"
521
+ ]);
522
+ var SPECIAL_FILENAMES = /* @__PURE__ */ new Set([
523
+ "Makefile",
524
+ "Dockerfile",
525
+ ".dockerignore",
526
+ ".npmrc",
527
+ ".envrc",
528
+ ".htgroup",
529
+ ".eslintignore",
530
+ ".env.test",
531
+ ".env.local",
532
+ ".env.production",
533
+ ".env.development",
534
+ ".env.example",
535
+ ".dockerfile",
536
+ ".htaccess",
537
+ ".htpasswd",
538
+ ".babelrc",
539
+ ".eslintrc",
540
+ ".editorconfig",
541
+ ".prettierignore",
542
+ "docker-compose.override.yml",
543
+ "docker-compose.yml",
544
+ "Vagrantfile",
545
+ "Procfile",
546
+ "Gemfile",
547
+ "Rakefile",
548
+ "package.json",
549
+ "package-lock.json",
550
+ "yarn.lock",
551
+ "pnpm-lock.yaml",
552
+ "tsconfig.json",
553
+ "webpack.config.js",
554
+ "vite.config.js",
555
+ "vite.config.ts",
556
+ "Gruntfile.js",
557
+ "gulpfile.js",
558
+ "babel.config.js",
559
+ "babel.js",
560
+ "rollup.js",
561
+ // SPECIAL PRESERVE NAME
562
+ "CON",
563
+ "NUL",
564
+ "PRN",
565
+ "AUX",
566
+ "COM1",
567
+ "COM2",
568
+ "COM3",
569
+ "COM4",
570
+ "COM5",
571
+ "COM6",
572
+ "COM7",
573
+ "COM8",
574
+ "COM9",
575
+ "LPT1",
576
+ "LPT2",
577
+ "LPT3",
578
+ "LPT4",
579
+ "LPT5",
580
+ "LPT6",
581
+ "LPT7",
582
+ "LPT8",
583
+ "LPT9"
584
+ ]);
585
+
586
+ var extractFileName = (input, options = {}) => {
587
+ if (!isNonEmptyString(input)) return null;
588
+ assertIsPlainObject(options, {
589
+ message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
590
+ });
591
+ const { domainName, domainAware = false } = options;
592
+ assertIsBoolean(domainAware, {
593
+ message: ({ currentType, validType }) => `Parameter \`domainAware\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
594
+ });
595
+ let pathname = input.trim();
596
+ pathname = pathname.replace(/\\/g, "/");
597
+ if (domainAware) {
598
+ if (!isNonEmptyString(domainName)) {
599
+ throw new TypeError(
600
+ `If parameter \`domainAware\` is set to \`true\`, the option parameter \`domainName\` is required as string, and cant be an empty-string.`
601
+ );
602
+ }
603
+ const cleanDomain = punycodeUtilsJS.toASCII(domainName).replace(/^https?:\/\//i, "").replace(/^www\./, "").replace(/\/.*$/, "").toLowerCase();
604
+ const inputDomain = punycodeUtilsJS.toASCII(input).replace(/^https?:\/\//i, "").replace(/^www\./, "").toLowerCase();
605
+ const inputHost = inputDomain.split("/")[0].split(/[?#]/)[0];
606
+ const matchesDomain = inputHost === cleanDomain || inputHost.endsWith(`.${cleanDomain}`);
607
+ const hasPath = /\/[^/]+$/.test(inputDomain);
608
+ if (matchesDomain && !hasPath) return null;
609
+ }
610
+ const protocolMatch = pathname.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):(.+)$/);
611
+ if (protocolMatch) {
612
+ const scheme = protocolMatch[1].toLowerCase();
613
+ const rest = protocolMatch[2];
614
+ if (["tel", "sms"].some((sch) => sch.startsWith(scheme))) {
615
+ const clean = rest.split("?")[0].split("#")[0];
616
+ return clean.trim() || null;
617
+ } else if (scheme === "mailto") {
618
+ const parts = rest.split("/");
619
+ let last = parts[parts.length - 1];
620
+ last = last.split("?")[0].split("#")[0];
621
+ const dotIndex = last.lastIndexOf(".");
622
+ if (dotIndex > 0) last = last.slice(0, dotIndex);
623
+ return last || null;
624
+ } else if (scheme === "data") {
625
+ const commaIndex = rest.indexOf(",");
626
+ if (commaIndex === -1) return null;
627
+ let payload = rest.slice(commaIndex + 1);
628
+ payload = payload.split("?")[0].split("#")[0];
629
+ return payload.trim() || null;
630
+ }
631
+ }
632
+ if (/^[a-z][a-z\d+\-.]*:\/{3,}/i.test(pathname)) {
633
+ pathname = pathname.replace(/^[a-z][a-z\d+\-.]*:\/{2,}/i, "");
634
+ } else {
635
+ try {
636
+ const isProbablyUrl = /^[a-z][a-z\d+\-.]*:(\/\/)?/i.test(pathname);
637
+ pathname = isProbablyUrl ? new URL(pathname).pathname : new URL(`http://localhost/${pathname}`).pathname;
638
+ } catch {
639
+ pathname = pathname.replace(/^[a-z][a-z\d+\-.]*:(\/\/)?/i, "");
640
+ }
641
+ }
642
+ const segments = pathname.split("/").filter(Boolean);
643
+ if (segments.length === 0) return null;
644
+ let lastSegment = segments[segments.length - 1].split("?")[0].split("#")[0];
645
+ lastSegment = lastSegment.replace(/[?#]+$/, "");
646
+ if (!lastSegment) return null;
647
+ lastSegment = lastSegment.replace(/%2F/gi, "/").replace(/%5C/gi, "\\").replace(/%2E/gi, ".");
648
+ if (lastSegment.includes("/")) {
649
+ const parts = lastSegment.split("/").filter(Boolean);
650
+ lastSegment = parts[parts.length - 1];
651
+ }
652
+ let filename = decodeURIComponent(lastSegment);
653
+ if (!filename) return null;
654
+ if (SPECIAL_FILENAMES.has(filename)) return filename;
655
+ if (/^\.[^.\s][^/]*$/.test(filename)) return filename;
656
+ if (!filename.includes(".")) return null;
657
+ const sortedDouble = [...DOUBLE_EXTENSIONS_FILE].sort((a, b) => b.length - a.length);
658
+ for (const ext of sortedDouble) {
659
+ const dotExt = `.${ext.toLowerCase()}`;
660
+ if (filename.toLowerCase().endsWith(dotExt)) {
661
+ filename = filename.slice(0, filename.length - dotExt.length);
662
+ break;
663
+ }
664
+ }
665
+ const sortedSingle = [...EXTENSIONS_FILE].sort((a, b) => b.length - a.length);
666
+ for (const ext of sortedSingle) {
667
+ const dotExt = `.${ext.toLowerCase()}`;
668
+ if (filename.toLowerCase().endsWith(dotExt)) {
669
+ filename = filename.slice(0, filename.length - dotExt.length);
670
+ break;
671
+ }
672
+ }
673
+ return filename || null;
674
+ };
675
+
676
+ export { extractFileName };
@@ -2,21 +2,21 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.8.0.
5
+ * Version: 3.9.1.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
9
9
  */
10
10
  'use strict';
11
11
 
12
- var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
12
+ var chunk7C7TQC5J_cjs = require('./chunk-7C7TQC5J.cjs');
13
13
 
14
14
  var normalizeSpaces = (value, options = {
15
15
  withTrim: true,
16
16
  trimOnly: false
17
17
  }) => {
18
- if (!chunkF3WBQKRI_cjs.isNonEmptyString(value)) return "";
19
- if (!chunkF3WBQKRI_cjs.isPlainObject(options)) {
18
+ if (!chunk7C7TQC5J_cjs.isNonEmptyString(value)) return "";
19
+ if (!chunk7C7TQC5J_cjs.isPlainObject(options)) {
20
20
  options = {};
21
21
  }
22
22
  const { trimOnly = false, withTrim = true } = options;