@rzl-zone/utils-js 3.4.0 → 3.5.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.
- package/LICENSE.md +1 -1
- package/README.md +94 -45
- package/dist/assertions/index.cjs +41 -1
- package/dist/assertions/index.d.ts +11 -2
- package/dist/assertions/index.js +14 -1
- package/dist/chunk-2CQX5CBG.js +262 -1
- package/dist/chunk-2IOOEY45.cjs +30 -1
- package/dist/chunk-2WA36TC5.cjs +189 -0
- package/dist/chunk-3IBQ5MOM.js +16 -1
- package/dist/chunk-3VA554KW.js +34 -1
- package/dist/chunk-5757UBXJ.cjs +157 -1
- package/dist/chunk-5IGC6PBH.js +33 -1
- package/dist/chunk-5KJFVIQT.cjs +65 -1
- package/dist/chunk-6JFCSH7J.js +35 -1
- package/dist/chunk-6JFZL7YE.cjs +24 -1
- package/dist/chunk-7ODAAXX5.cjs +397 -1
- package/dist/chunk-BAV5T2E3.cjs +15 -1
- package/dist/chunk-CAH33WOQ.cjs +36 -1
- package/dist/chunk-CDCERIZ2.js +177 -0
- package/dist/chunk-CKTLUNWX.js +22 -1
- package/dist/chunk-CMW2TBOQ.js +567 -1
- package/dist/chunk-D3ENH7H6.cjs +101 -1
- package/dist/chunk-DEZZUYE2.js +152 -1
- package/dist/chunk-DVMHRLKP.cjs +16 -1
- package/dist/chunk-DWF2R5GD.cjs +225 -1
- package/dist/chunk-E55EQK2U.cjs +18 -1
- package/dist/chunk-E74U6CYP.cjs +18 -1
- package/dist/chunk-EL6A35UR.cjs +64 -1
- package/dist/chunk-F6IPNNSJ.cjs +554 -1
- package/dist/chunk-FJZGG54N.cjs +267 -1
- package/dist/chunk-FWCKOJZM.js +542 -1
- package/dist/chunk-FWHNWL2P.cjs +419 -1
- package/dist/chunk-GGEADHZO.js +90 -1
- package/dist/chunk-GQR4R5WY.js +31 -1
- package/dist/chunk-H66AC7GK.cjs +93 -1
- package/dist/chunk-HQWOFR56.cjs +33 -1
- package/dist/chunk-HYRQMTRH.cjs +24 -1
- package/dist/chunk-IRFL4MAX.js +63 -1
- package/dist/chunk-IVL7CKVH.cjs +37 -1
- package/dist/chunk-IZPBKKPO.js +16 -1
- package/dist/chunk-JBQMXC5I.cjs +106 -1
- package/dist/chunk-JEQEF5WD.js +95 -1
- package/dist/chunk-JMJQCN74.js +370 -1
- package/dist/chunk-KHO2SBNA.cjs +16 -1
- package/dist/chunk-KVAL5PAG.cjs +26 -1
- package/dist/chunk-L5RDAVVH.js +14 -1
- package/dist/chunk-LS6U7FAY.cjs +110 -1
- package/dist/chunk-NBZWMBO6.js +101 -1
- package/dist/chunk-NRF6LWBC.cjs +56 -1
- package/dist/chunk-OI5XKNZO.js +53 -1
- package/dist/chunk-ONZFBJVW.js +14 -1
- package/dist/chunk-OYTYSY7G.js +106 -1
- package/dist/chunk-PET42Z7W.js +119 -1
- package/dist/chunk-PZQ6I4JJ.cjs +605 -1
- package/dist/chunk-QBKAEVYG.js +113 -1
- package/dist/chunk-QNKGP5DY.js +14 -1
- package/dist/chunk-RIPKY4RU.js +417 -1
- package/dist/chunk-RZW35UN5.cjs +116 -1
- package/dist/chunk-SBFNXGTJ.js +220 -1
- package/dist/chunk-SBKGWRS5.js +22 -1
- package/dist/chunk-SIM77PU4.js +59 -1
- package/dist/chunk-T2T7K3KR.js +28 -1
- package/dist/chunk-T7PU2V7X.cjs +123 -1
- package/dist/chunk-UDA26MCU.cjs +16 -1
- package/dist/chunk-V45XJKHW.cjs +18 -1
- package/dist/chunk-VJDDGRIK.cjs +16 -1
- package/dist/chunk-W2WNBUDE.js +16 -1
- package/dist/chunk-WVSPXFTY.js +14 -1
- package/dist/chunk-XABCB3Y7.cjs +582 -1
- package/dist/chunk-XEDXFSGI.js +24 -1
- package/dist/chunk-YKPSRP5G.js +571 -1
- package/dist/chunk-YWHHVDT4.js +13 -1
- package/dist/chunk-ZETAZZLD.cjs +38 -1
- package/dist/conversions/index.cjs +104 -1
- package/dist/conversions/index.d.ts +10 -1
- package/dist/conversions/index.js +25 -1
- package/dist/events/index.cjs +32 -1
- package/dist/events/index.d.ts +10 -1
- package/dist/events/index.js +13 -1
- package/dist/formatters/index.cjs +62 -1
- package/dist/formatters/index.d.ts +10 -1
- package/dist/formatters/index.js +19 -1
- package/dist/generators/index.cjs +38 -1
- package/dist/generators/index.d.ts +10 -1
- package/dist/generators/index.js +15 -1
- package/dist/index.d.ts +39 -12
- package/dist/{isPlainObject-CEPWPiXh.d.ts → isPlainObject-FWmcJF6k.d.ts} +13 -4
- package/dist/next/index.cjs +218 -1
- package/dist/next/index.d.ts +10 -1
- package/dist/next/index.js +213 -1
- package/dist/next/server/index.cjs +43 -1
- package/dist/next/server/index.d.ts +10 -1
- package/dist/next/server/index.js +41 -1
- package/dist/operations/index.cjs +33 -1
- package/dist/operations/index.d.ts +10 -1
- package/dist/operations/index.js +18 -1
- package/dist/parsers/index.cjs +18 -1
- package/dist/parsers/index.d.ts +10 -1
- package/dist/parsers/index.js +11 -1
- package/dist/predicates/index.cjs +299 -1
- package/dist/predicates/index.d.ts +13 -4
- package/dist/predicates/index.js +24 -1
- package/dist/promises/index.cjs +25 -1
- package/dist/promises/index.d.ts +10 -1
- package/dist/promises/index.js +14 -1
- package/dist/rzl-utils.global.js +25 -1
- package/dist/strings/index.cjs +82 -1
- package/dist/strings/index.d.ts +10 -1
- package/dist/strings/index.js +15 -1
- package/dist/tailwind/index.cjs +43 -1
- package/dist/tailwind/index.d.ts +10 -1
- package/dist/tailwind/index.js +12 -1
- package/dist/urls/index.cjs +51 -1
- package/dist/urls/index.d.ts +10 -1
- package/dist/urls/index.js +24 -1
- package/package.json +60 -179
- package/dist/chunk-JYQTCICM.js +0 -1
- package/dist/chunk-YLA3DURS.cjs +0 -1
package/dist/chunk-QBKAEVYG.js
CHANGED
|
@@ -1 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
import { isInteger } from './chunk-WVSPXFTY.js';
|
|
11
|
+
import { safeStableStringify } from './chunk-PET42Z7W.js';
|
|
12
|
+
import { getPreciseType, isNull } from './chunk-CMW2TBOQ.js';
|
|
13
|
+
|
|
14
|
+
var CustomPromise = class extends Promise {
|
|
15
|
+
_value;
|
|
16
|
+
_error;
|
|
17
|
+
_finish = [];
|
|
18
|
+
constructor(executor) {
|
|
19
|
+
let resolveOuter;
|
|
20
|
+
let rejectOuter;
|
|
21
|
+
super((resolve, reject) => {
|
|
22
|
+
resolveOuter = resolve;
|
|
23
|
+
rejectOuter = reject;
|
|
24
|
+
});
|
|
25
|
+
executor(
|
|
26
|
+
(v) => {
|
|
27
|
+
this._value = v;
|
|
28
|
+
resolveOuter(v);
|
|
29
|
+
this._finish.forEach((f) => f(v, void 0));
|
|
30
|
+
},
|
|
31
|
+
(e) => {
|
|
32
|
+
this._error = e;
|
|
33
|
+
rejectOuter(e);
|
|
34
|
+
this._finish.forEach((f) => f(void 0, e));
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
38
|
+
}
|
|
39
|
+
then(onfulfilled, onrejected) {
|
|
40
|
+
return super.then(onfulfilled, onrejected);
|
|
41
|
+
}
|
|
42
|
+
catch(onrejected) {
|
|
43
|
+
return super.catch(onrejected);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Registers a callback to be invoked **exactly once** when the
|
|
47
|
+
* promise settles, with access to both the resolved value and
|
|
48
|
+
* the rejection reason.
|
|
49
|
+
*
|
|
50
|
+
* If the promise is already settled when `finish` is called,
|
|
51
|
+
* the callback executes immediately on the same tick.
|
|
52
|
+
*
|
|
53
|
+
* @param cb Callback receiving the final `(value, error)`.
|
|
54
|
+
* @returns `this` for fluent chaining.
|
|
55
|
+
*/
|
|
56
|
+
finish(cb) {
|
|
57
|
+
if (this._value !== void 0 || this._error !== void 0) {
|
|
58
|
+
cb(this._value, this._error);
|
|
59
|
+
} else {
|
|
60
|
+
this._finish.push(cb);
|
|
61
|
+
}
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var AbortError = class extends Error {
|
|
67
|
+
constructor(message = "The operation was aborted", name = "AbortError") {
|
|
68
|
+
super(message);
|
|
69
|
+
this.name = name;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var delay = (milliSeconds = 1e3, signal) => {
|
|
73
|
+
if (!isInteger(milliSeconds) || milliSeconds <= 0) {
|
|
74
|
+
throw new TypeError(
|
|
75
|
+
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${getPreciseType(
|
|
76
|
+
milliSeconds
|
|
77
|
+
)}\`, with value: \`${safeStableStringify(milliSeconds)}\`.`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (isNull(signal) || signal && !(signal instanceof AbortSignal)) {
|
|
81
|
+
throw new TypeError(
|
|
82
|
+
"Second parameter (`signal`) must be an `instance of AbortSignal` if provided."
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return new Promise((resolve, reject) => {
|
|
86
|
+
const timer = setTimeout(() => {
|
|
87
|
+
cleanup();
|
|
88
|
+
resolve();
|
|
89
|
+
}, milliSeconds);
|
|
90
|
+
const cleanup = () => {
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
if (signal) signal.removeEventListener("abort", onAbort);
|
|
93
|
+
};
|
|
94
|
+
const onAbort = () => {
|
|
95
|
+
cleanup();
|
|
96
|
+
reject(
|
|
97
|
+
new AbortError(
|
|
98
|
+
"Function `delay` from `@rzl-zone/utils-js` was aborted.",
|
|
99
|
+
"AbortError"
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
if (signal) {
|
|
104
|
+
if (signal.aborted) {
|
|
105
|
+
onAbort();
|
|
106
|
+
} else {
|
|
107
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export { CustomPromise, delay };
|
package/dist/chunk-QNKGP5DY.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
var isBigInt = (value) => {
|
|
11
|
+
return typeof value === "bigint";
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { isBigInt };
|
package/dist/chunk-RIPKY4RU.js
CHANGED
|
@@ -1 +1,417 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
import { isNonEmptyString } from './chunk-CMW2TBOQ.js';
|
|
11
|
+
|
|
12
|
+
var KNOWN_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
13
|
+
// 📄 Text & Document
|
|
14
|
+
"txt",
|
|
15
|
+
"md",
|
|
16
|
+
"rtf",
|
|
17
|
+
"tex",
|
|
18
|
+
"doc",
|
|
19
|
+
"docx",
|
|
20
|
+
"odt",
|
|
21
|
+
"ott",
|
|
22
|
+
"pdf",
|
|
23
|
+
"djvu",
|
|
24
|
+
"epub",
|
|
25
|
+
"mobi",
|
|
26
|
+
"azw",
|
|
27
|
+
"azw3",
|
|
28
|
+
"xls",
|
|
29
|
+
"xlsx",
|
|
30
|
+
"ods",
|
|
31
|
+
"csv",
|
|
32
|
+
"tsv",
|
|
33
|
+
"ppt",
|
|
34
|
+
"pptx",
|
|
35
|
+
"odp",
|
|
36
|
+
"pps",
|
|
37
|
+
"md",
|
|
38
|
+
"bib",
|
|
39
|
+
"tex",
|
|
40
|
+
"log",
|
|
41
|
+
// 🖼️ Image
|
|
42
|
+
"jpg",
|
|
43
|
+
"jpeg",
|
|
44
|
+
"png",
|
|
45
|
+
"gif",
|
|
46
|
+
"bmp",
|
|
47
|
+
"tif",
|
|
48
|
+
"tiff",
|
|
49
|
+
"webp",
|
|
50
|
+
"svg",
|
|
51
|
+
"ico",
|
|
52
|
+
"heif",
|
|
53
|
+
"heic",
|
|
54
|
+
"raw",
|
|
55
|
+
"cr2",
|
|
56
|
+
"nef",
|
|
57
|
+
"orf",
|
|
58
|
+
"sr2",
|
|
59
|
+
"dng",
|
|
60
|
+
"dds",
|
|
61
|
+
"psd",
|
|
62
|
+
"exr",
|
|
63
|
+
"xcf",
|
|
64
|
+
"ai",
|
|
65
|
+
"eps",
|
|
66
|
+
"cdr",
|
|
67
|
+
"psd",
|
|
68
|
+
"indd",
|
|
69
|
+
// 🎵 Audio
|
|
70
|
+
"mp3",
|
|
71
|
+
"wav",
|
|
72
|
+
"ogg",
|
|
73
|
+
"flac",
|
|
74
|
+
"aac",
|
|
75
|
+
"m4a",
|
|
76
|
+
"wma",
|
|
77
|
+
"alac",
|
|
78
|
+
"aiff",
|
|
79
|
+
"amr",
|
|
80
|
+
"mid",
|
|
81
|
+
"midi",
|
|
82
|
+
"opus",
|
|
83
|
+
"au",
|
|
84
|
+
"caf",
|
|
85
|
+
"ape",
|
|
86
|
+
"opus",
|
|
87
|
+
// 🎥 Video
|
|
88
|
+
"mp4",
|
|
89
|
+
"mkv",
|
|
90
|
+
"avi",
|
|
91
|
+
"mov",
|
|
92
|
+
"flv",
|
|
93
|
+
"wmv",
|
|
94
|
+
"webm",
|
|
95
|
+
"mpeg",
|
|
96
|
+
"mpg",
|
|
97
|
+
"3gp",
|
|
98
|
+
"3g2",
|
|
99
|
+
"m4v",
|
|
100
|
+
"ts",
|
|
101
|
+
"mts",
|
|
102
|
+
"asf",
|
|
103
|
+
"rm",
|
|
104
|
+
"rmvb",
|
|
105
|
+
"vob",
|
|
106
|
+
"f4v",
|
|
107
|
+
"ogv",
|
|
108
|
+
"m2ts",
|
|
109
|
+
"mod",
|
|
110
|
+
"dav",
|
|
111
|
+
// 🗃️ Archive & Compression
|
|
112
|
+
"zip",
|
|
113
|
+
"rar",
|
|
114
|
+
"7z",
|
|
115
|
+
"tar",
|
|
116
|
+
"gz",
|
|
117
|
+
"bz2",
|
|
118
|
+
"xz",
|
|
119
|
+
"tgz",
|
|
120
|
+
"tbz2",
|
|
121
|
+
"txz",
|
|
122
|
+
"lz",
|
|
123
|
+
"lzma",
|
|
124
|
+
"z",
|
|
125
|
+
"cab",
|
|
126
|
+
"arj",
|
|
127
|
+
"ace",
|
|
128
|
+
"iso",
|
|
129
|
+
"dmg",
|
|
130
|
+
"rpm",
|
|
131
|
+
"deb",
|
|
132
|
+
"pkg",
|
|
133
|
+
"apk",
|
|
134
|
+
"jar",
|
|
135
|
+
// 💾 Disk Image
|
|
136
|
+
"iso",
|
|
137
|
+
"img",
|
|
138
|
+
"vhd",
|
|
139
|
+
"vmdk",
|
|
140
|
+
"qcow2",
|
|
141
|
+
"dmg",
|
|
142
|
+
// 🗃️ Database & Data
|
|
143
|
+
"sql",
|
|
144
|
+
"db",
|
|
145
|
+
"dbf",
|
|
146
|
+
"mdb",
|
|
147
|
+
"accdb",
|
|
148
|
+
"json",
|
|
149
|
+
"xml",
|
|
150
|
+
"yaml",
|
|
151
|
+
"yml",
|
|
152
|
+
"toml",
|
|
153
|
+
"ini",
|
|
154
|
+
"plist",
|
|
155
|
+
"yaml",
|
|
156
|
+
"pkl",
|
|
157
|
+
"msgpack",
|
|
158
|
+
"h5",
|
|
159
|
+
"hdf5",
|
|
160
|
+
"parquet",
|
|
161
|
+
"avro",
|
|
162
|
+
"orc",
|
|
163
|
+
"ndjson",
|
|
164
|
+
"db",
|
|
165
|
+
"pdb",
|
|
166
|
+
"sqlite",
|
|
167
|
+
"sqlite3",
|
|
168
|
+
"dbx",
|
|
169
|
+
"sdf",
|
|
170
|
+
// 💻 Code & Script
|
|
171
|
+
"js",
|
|
172
|
+
"jsx",
|
|
173
|
+
"ts",
|
|
174
|
+
"tsx",
|
|
175
|
+
"c",
|
|
176
|
+
"cpp",
|
|
177
|
+
"h",
|
|
178
|
+
"hpp",
|
|
179
|
+
"java",
|
|
180
|
+
"py",
|
|
181
|
+
"rb",
|
|
182
|
+
"go",
|
|
183
|
+
"rs",
|
|
184
|
+
"php",
|
|
185
|
+
"pl",
|
|
186
|
+
"sh",
|
|
187
|
+
"bat",
|
|
188
|
+
"cmd",
|
|
189
|
+
"ps1",
|
|
190
|
+
"lua",
|
|
191
|
+
"swift",
|
|
192
|
+
"kt",
|
|
193
|
+
"scala",
|
|
194
|
+
"cs",
|
|
195
|
+
"vb",
|
|
196
|
+
"dart",
|
|
197
|
+
"m",
|
|
198
|
+
"r",
|
|
199
|
+
"jl",
|
|
200
|
+
"fs",
|
|
201
|
+
"vbproj",
|
|
202
|
+
"sln",
|
|
203
|
+
"pri",
|
|
204
|
+
"Makefile",
|
|
205
|
+
// 🌐 Web & Config
|
|
206
|
+
"html",
|
|
207
|
+
"htm",
|
|
208
|
+
"xhtml",
|
|
209
|
+
"css",
|
|
210
|
+
"scss",
|
|
211
|
+
"sass",
|
|
212
|
+
"less",
|
|
213
|
+
"xml",
|
|
214
|
+
"json",
|
|
215
|
+
"yaml",
|
|
216
|
+
"yml",
|
|
217
|
+
"xlf",
|
|
218
|
+
"xlf",
|
|
219
|
+
"po",
|
|
220
|
+
"pot",
|
|
221
|
+
"jsp",
|
|
222
|
+
"asp",
|
|
223
|
+
"aspx",
|
|
224
|
+
"php",
|
|
225
|
+
"jspf",
|
|
226
|
+
"cgi",
|
|
227
|
+
"cfm",
|
|
228
|
+
"pl",
|
|
229
|
+
"env",
|
|
230
|
+
"conf",
|
|
231
|
+
"config",
|
|
232
|
+
"xml",
|
|
233
|
+
"ini",
|
|
234
|
+
"cfg",
|
|
235
|
+
"toml",
|
|
236
|
+
"yaml",
|
|
237
|
+
"dockerfile",
|
|
238
|
+
"gitignore",
|
|
239
|
+
"gitconfig",
|
|
240
|
+
"gitattributes",
|
|
241
|
+
"npmignore",
|
|
242
|
+
"lock",
|
|
243
|
+
"gradle",
|
|
244
|
+
"pom",
|
|
245
|
+
"yaml",
|
|
246
|
+
"prettierrc",
|
|
247
|
+
"eslintrc",
|
|
248
|
+
"babelrc",
|
|
249
|
+
"editorconfig",
|
|
250
|
+
// 🔠 Font
|
|
251
|
+
"ttf",
|
|
252
|
+
"otf",
|
|
253
|
+
"woff",
|
|
254
|
+
"woff2",
|
|
255
|
+
"eot",
|
|
256
|
+
// 🗺️ CAD & GIS
|
|
257
|
+
"dwg",
|
|
258
|
+
"dxf",
|
|
259
|
+
"shp",
|
|
260
|
+
"kml",
|
|
261
|
+
"kmz",
|
|
262
|
+
"gpx",
|
|
263
|
+
"stl",
|
|
264
|
+
"step",
|
|
265
|
+
"iges",
|
|
266
|
+
"3ds",
|
|
267
|
+
"3dm",
|
|
268
|
+
"fbx",
|
|
269
|
+
"obj",
|
|
270
|
+
// 🔧 System / Binary / Execution
|
|
271
|
+
"exe",
|
|
272
|
+
"msi",
|
|
273
|
+
"bin",
|
|
274
|
+
"run",
|
|
275
|
+
"com",
|
|
276
|
+
"cmd",
|
|
277
|
+
"apk",
|
|
278
|
+
"app",
|
|
279
|
+
"deb",
|
|
280
|
+
"rpm",
|
|
281
|
+
"elf",
|
|
282
|
+
"dll",
|
|
283
|
+
"so",
|
|
284
|
+
"dylib",
|
|
285
|
+
"sys",
|
|
286
|
+
// 🔐 Certificates / Crypto
|
|
287
|
+
"pem",
|
|
288
|
+
"crt",
|
|
289
|
+
"cer",
|
|
290
|
+
"key",
|
|
291
|
+
"der",
|
|
292
|
+
"csr",
|
|
293
|
+
"p12",
|
|
294
|
+
"pfx",
|
|
295
|
+
"jks",
|
|
296
|
+
// 🎮 Games & Projects
|
|
297
|
+
"iso",
|
|
298
|
+
"cue",
|
|
299
|
+
"bin",
|
|
300
|
+
"nes",
|
|
301
|
+
"sfc",
|
|
302
|
+
"gba",
|
|
303
|
+
"nds",
|
|
304
|
+
"nes",
|
|
305
|
+
"sav",
|
|
306
|
+
"rom",
|
|
307
|
+
"pak",
|
|
308
|
+
"vpk",
|
|
309
|
+
"bik",
|
|
310
|
+
// 📚 E-books and Comics
|
|
311
|
+
"epub",
|
|
312
|
+
"mobi",
|
|
313
|
+
"azw",
|
|
314
|
+
"azw3",
|
|
315
|
+
"fb2",
|
|
316
|
+
"lit",
|
|
317
|
+
"lrf",
|
|
318
|
+
"cbr",
|
|
319
|
+
"cbz",
|
|
320
|
+
"cbt",
|
|
321
|
+
"cba",
|
|
322
|
+
"opds",
|
|
323
|
+
// 🔬 Bioinformatics
|
|
324
|
+
"fasta",
|
|
325
|
+
"fa",
|
|
326
|
+
"fas",
|
|
327
|
+
"ffn",
|
|
328
|
+
"faa",
|
|
329
|
+
"fna",
|
|
330
|
+
"frn",
|
|
331
|
+
"fastq",
|
|
332
|
+
"fq",
|
|
333
|
+
"gb",
|
|
334
|
+
"gbk",
|
|
335
|
+
"sam",
|
|
336
|
+
"bam",
|
|
337
|
+
"vcf",
|
|
338
|
+
"gff",
|
|
339
|
+
"bed",
|
|
340
|
+
// 📝 Etc
|
|
341
|
+
"log",
|
|
342
|
+
"bak",
|
|
343
|
+
"tmp",
|
|
344
|
+
"old",
|
|
345
|
+
"backup",
|
|
346
|
+
"swp",
|
|
347
|
+
"part",
|
|
348
|
+
"crdownload",
|
|
349
|
+
"torrent",
|
|
350
|
+
"ics",
|
|
351
|
+
"vcf",
|
|
352
|
+
"ics",
|
|
353
|
+
"ical",
|
|
354
|
+
"ics",
|
|
355
|
+
"ical",
|
|
356
|
+
"calendar",
|
|
357
|
+
"srt",
|
|
358
|
+
"sub",
|
|
359
|
+
"idx",
|
|
360
|
+
"cue",
|
|
361
|
+
// 🧠 Other broad (technical & scientific extensions)
|
|
362
|
+
"cdf",
|
|
363
|
+
"hdf",
|
|
364
|
+
"h5",
|
|
365
|
+
"nc",
|
|
366
|
+
"grib",
|
|
367
|
+
"fits",
|
|
368
|
+
"netcdf",
|
|
369
|
+
"sdf",
|
|
370
|
+
"vtk",
|
|
371
|
+
"xmind",
|
|
372
|
+
"drawio",
|
|
373
|
+
// ⚙️ Packages & Plugins
|
|
374
|
+
"jar",
|
|
375
|
+
"war",
|
|
376
|
+
"ear",
|
|
377
|
+
"crx",
|
|
378
|
+
"xpi",
|
|
379
|
+
"plugin",
|
|
380
|
+
"vsix",
|
|
381
|
+
"safariextz"
|
|
382
|
+
]);
|
|
383
|
+
var DOUBLE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
384
|
+
"tar.gz",
|
|
385
|
+
"tar.bz2",
|
|
386
|
+
"tar.xz",
|
|
387
|
+
"tar.lz",
|
|
388
|
+
"tar.lzma",
|
|
389
|
+
"tar.Z",
|
|
390
|
+
"tar.zst",
|
|
391
|
+
"tar.xz"
|
|
392
|
+
]);
|
|
393
|
+
var extractFileName = (url) => {
|
|
394
|
+
if (!isNonEmptyString(url)) return void 0;
|
|
395
|
+
let fileName = url.split("/").pop();
|
|
396
|
+
if (fileName === "") return "";
|
|
397
|
+
if (!fileName) return void 0;
|
|
398
|
+
for (const ext of DOUBLE_EXTENSIONS) {
|
|
399
|
+
const fullExt = `.${ext}`;
|
|
400
|
+
if (fileName.toLowerCase().endsWith(fullExt)) {
|
|
401
|
+
return fileName.slice(0, -fullExt.length);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
while (true) {
|
|
405
|
+
const lastDot = fileName.lastIndexOf(".");
|
|
406
|
+
if (lastDot === -1) break;
|
|
407
|
+
const ext = fileName.slice(lastDot + 1).toLowerCase();
|
|
408
|
+
if (KNOWN_EXTENSIONS.has(ext)) {
|
|
409
|
+
fileName = fileName.slice(0, lastDot);
|
|
410
|
+
} else {
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return fileName;
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
export { extractFileName };
|
package/dist/chunk-RZW35UN5.cjs
CHANGED
|
@@ -1 +1,116 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
|
|
13
|
+
var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
|
|
14
|
+
var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
|
|
15
|
+
|
|
16
|
+
var CustomPromise = class extends Promise {
|
|
17
|
+
_value;
|
|
18
|
+
_error;
|
|
19
|
+
_finish = [];
|
|
20
|
+
constructor(executor) {
|
|
21
|
+
let resolveOuter;
|
|
22
|
+
let rejectOuter;
|
|
23
|
+
super((resolve, reject) => {
|
|
24
|
+
resolveOuter = resolve;
|
|
25
|
+
rejectOuter = reject;
|
|
26
|
+
});
|
|
27
|
+
executor(
|
|
28
|
+
(v) => {
|
|
29
|
+
this._value = v;
|
|
30
|
+
resolveOuter(v);
|
|
31
|
+
this._finish.forEach((f) => f(v, void 0));
|
|
32
|
+
},
|
|
33
|
+
(e) => {
|
|
34
|
+
this._error = e;
|
|
35
|
+
rejectOuter(e);
|
|
36
|
+
this._finish.forEach((f) => f(void 0, e));
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
40
|
+
}
|
|
41
|
+
then(onfulfilled, onrejected) {
|
|
42
|
+
return super.then(onfulfilled, onrejected);
|
|
43
|
+
}
|
|
44
|
+
catch(onrejected) {
|
|
45
|
+
return super.catch(onrejected);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Registers a callback to be invoked **exactly once** when the
|
|
49
|
+
* promise settles, with access to both the resolved value and
|
|
50
|
+
* the rejection reason.
|
|
51
|
+
*
|
|
52
|
+
* If the promise is already settled when `finish` is called,
|
|
53
|
+
* the callback executes immediately on the same tick.
|
|
54
|
+
*
|
|
55
|
+
* @param cb Callback receiving the final `(value, error)`.
|
|
56
|
+
* @returns `this` for fluent chaining.
|
|
57
|
+
*/
|
|
58
|
+
finish(cb) {
|
|
59
|
+
if (this._value !== void 0 || this._error !== void 0) {
|
|
60
|
+
cb(this._value, this._error);
|
|
61
|
+
} else {
|
|
62
|
+
this._finish.push(cb);
|
|
63
|
+
}
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var AbortError = class extends Error {
|
|
69
|
+
constructor(message = "The operation was aborted", name = "AbortError") {
|
|
70
|
+
super(message);
|
|
71
|
+
this.name = name;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var delay = (milliSeconds = 1e3, signal) => {
|
|
75
|
+
if (!chunkDVMHRLKP_cjs.isInteger(milliSeconds) || milliSeconds <= 0) {
|
|
76
|
+
throw new TypeError(
|
|
77
|
+
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${chunkPZQ6I4JJ_cjs.getPreciseType(
|
|
78
|
+
milliSeconds
|
|
79
|
+
)}\`, with value: \`${chunkT7PU2V7X_cjs.safeStableStringify(milliSeconds)}\`.`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (chunkPZQ6I4JJ_cjs.isNull(signal) || signal && !(signal instanceof AbortSignal)) {
|
|
83
|
+
throw new TypeError(
|
|
84
|
+
"Second parameter (`signal`) must be an `instance of AbortSignal` if provided."
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
const timer = setTimeout(() => {
|
|
89
|
+
cleanup();
|
|
90
|
+
resolve();
|
|
91
|
+
}, milliSeconds);
|
|
92
|
+
const cleanup = () => {
|
|
93
|
+
clearTimeout(timer);
|
|
94
|
+
if (signal) signal.removeEventListener("abort", onAbort);
|
|
95
|
+
};
|
|
96
|
+
const onAbort = () => {
|
|
97
|
+
cleanup();
|
|
98
|
+
reject(
|
|
99
|
+
new AbortError(
|
|
100
|
+
"Function `delay` from `@rzl-zone/utils-js` was aborted.",
|
|
101
|
+
"AbortError"
|
|
102
|
+
)
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
if (signal) {
|
|
106
|
+
if (signal.aborted) {
|
|
107
|
+
onAbort();
|
|
108
|
+
} else {
|
|
109
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.CustomPromise = CustomPromise;
|
|
116
|
+
exports.delay = delay;
|