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