@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.
Files changed (118) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +94 -45
  3. package/dist/assertions/index.cjs +41 -1
  4. package/dist/assertions/index.d.ts +11 -2
  5. package/dist/assertions/index.js +14 -1
  6. package/dist/chunk-2CQX5CBG.js +262 -1
  7. package/dist/chunk-2IOOEY45.cjs +30 -1
  8. package/dist/chunk-2WA36TC5.cjs +189 -0
  9. package/dist/chunk-3IBQ5MOM.js +16 -1
  10. package/dist/chunk-3VA554KW.js +34 -1
  11. package/dist/chunk-5757UBXJ.cjs +157 -1
  12. package/dist/chunk-5IGC6PBH.js +33 -1
  13. package/dist/chunk-5KJFVIQT.cjs +65 -1
  14. package/dist/chunk-6JFCSH7J.js +35 -1
  15. package/dist/chunk-6JFZL7YE.cjs +24 -1
  16. package/dist/chunk-7ODAAXX5.cjs +397 -1
  17. package/dist/chunk-BAV5T2E3.cjs +15 -1
  18. package/dist/chunk-CAH33WOQ.cjs +36 -1
  19. package/dist/chunk-CDCERIZ2.js +177 -0
  20. package/dist/chunk-CKTLUNWX.js +22 -1
  21. package/dist/chunk-CMW2TBOQ.js +567 -1
  22. package/dist/chunk-D3ENH7H6.cjs +101 -1
  23. package/dist/chunk-DEZZUYE2.js +152 -1
  24. package/dist/chunk-DVMHRLKP.cjs +16 -1
  25. package/dist/chunk-DWF2R5GD.cjs +225 -1
  26. package/dist/chunk-E55EQK2U.cjs +18 -1
  27. package/dist/chunk-E74U6CYP.cjs +18 -1
  28. package/dist/chunk-EL6A35UR.cjs +64 -1
  29. package/dist/chunk-F6IPNNSJ.cjs +554 -1
  30. package/dist/chunk-FJZGG54N.cjs +267 -1
  31. package/dist/chunk-FWCKOJZM.js +542 -1
  32. package/dist/chunk-FWHNWL2P.cjs +419 -1
  33. package/dist/chunk-GGEADHZO.js +90 -1
  34. package/dist/chunk-GQR4R5WY.js +31 -1
  35. package/dist/chunk-H66AC7GK.cjs +93 -1
  36. package/dist/chunk-HQWOFR56.cjs +33 -1
  37. package/dist/chunk-HYRQMTRH.cjs +24 -1
  38. package/dist/chunk-IRFL4MAX.js +63 -1
  39. package/dist/chunk-IVL7CKVH.cjs +37 -1
  40. package/dist/chunk-IZPBKKPO.js +16 -1
  41. package/dist/chunk-JBQMXC5I.cjs +106 -1
  42. package/dist/chunk-JEQEF5WD.js +95 -1
  43. package/dist/chunk-JMJQCN74.js +370 -1
  44. package/dist/chunk-KHO2SBNA.cjs +16 -1
  45. package/dist/chunk-KVAL5PAG.cjs +26 -1
  46. package/dist/chunk-L5RDAVVH.js +14 -1
  47. package/dist/chunk-LS6U7FAY.cjs +110 -1
  48. package/dist/chunk-NBZWMBO6.js +101 -1
  49. package/dist/chunk-NRF6LWBC.cjs +56 -1
  50. package/dist/chunk-OI5XKNZO.js +53 -1
  51. package/dist/chunk-ONZFBJVW.js +14 -1
  52. package/dist/chunk-OYTYSY7G.js +106 -1
  53. package/dist/chunk-PET42Z7W.js +119 -1
  54. package/dist/chunk-PZQ6I4JJ.cjs +605 -1
  55. package/dist/chunk-QBKAEVYG.js +113 -1
  56. package/dist/chunk-QNKGP5DY.js +14 -1
  57. package/dist/chunk-RIPKY4RU.js +417 -1
  58. package/dist/chunk-RZW35UN5.cjs +116 -1
  59. package/dist/chunk-SBFNXGTJ.js +220 -1
  60. package/dist/chunk-SBKGWRS5.js +22 -1
  61. package/dist/chunk-SIM77PU4.js +59 -1
  62. package/dist/chunk-T2T7K3KR.js +28 -1
  63. package/dist/chunk-T7PU2V7X.cjs +123 -1
  64. package/dist/chunk-UDA26MCU.cjs +16 -1
  65. package/dist/chunk-V45XJKHW.cjs +18 -1
  66. package/dist/chunk-VJDDGRIK.cjs +16 -1
  67. package/dist/chunk-W2WNBUDE.js +16 -1
  68. package/dist/chunk-WVSPXFTY.js +14 -1
  69. package/dist/chunk-XABCB3Y7.cjs +582 -1
  70. package/dist/chunk-XEDXFSGI.js +24 -1
  71. package/dist/chunk-YKPSRP5G.js +571 -1
  72. package/dist/chunk-YWHHVDT4.js +13 -1
  73. package/dist/chunk-ZETAZZLD.cjs +38 -1
  74. package/dist/conversions/index.cjs +104 -1
  75. package/dist/conversions/index.d.ts +10 -1
  76. package/dist/conversions/index.js +25 -1
  77. package/dist/events/index.cjs +32 -1
  78. package/dist/events/index.d.ts +10 -1
  79. package/dist/events/index.js +13 -1
  80. package/dist/formatters/index.cjs +62 -1
  81. package/dist/formatters/index.d.ts +10 -1
  82. package/dist/formatters/index.js +19 -1
  83. package/dist/generators/index.cjs +38 -1
  84. package/dist/generators/index.d.ts +10 -1
  85. package/dist/generators/index.js +15 -1
  86. package/dist/index.d.ts +39 -12
  87. package/dist/{isPlainObject-CEPWPiXh.d.ts → isPlainObject-FWmcJF6k.d.ts} +13 -4
  88. package/dist/next/index.cjs +218 -1
  89. package/dist/next/index.d.ts +10 -1
  90. package/dist/next/index.js +213 -1
  91. package/dist/next/server/index.cjs +43 -1
  92. package/dist/next/server/index.d.ts +10 -1
  93. package/dist/next/server/index.js +41 -1
  94. package/dist/operations/index.cjs +33 -1
  95. package/dist/operations/index.d.ts +10 -1
  96. package/dist/operations/index.js +18 -1
  97. package/dist/parsers/index.cjs +18 -1
  98. package/dist/parsers/index.d.ts +10 -1
  99. package/dist/parsers/index.js +11 -1
  100. package/dist/predicates/index.cjs +299 -1
  101. package/dist/predicates/index.d.ts +13 -4
  102. package/dist/predicates/index.js +24 -1
  103. package/dist/promises/index.cjs +25 -1
  104. package/dist/promises/index.d.ts +10 -1
  105. package/dist/promises/index.js +14 -1
  106. package/dist/rzl-utils.global.js +25 -1
  107. package/dist/strings/index.cjs +82 -1
  108. package/dist/strings/index.d.ts +10 -1
  109. package/dist/strings/index.js +15 -1
  110. package/dist/tailwind/index.cjs +43 -1
  111. package/dist/tailwind/index.d.ts +10 -1
  112. package/dist/tailwind/index.js +12 -1
  113. package/dist/urls/index.cjs +51 -1
  114. package/dist/urls/index.d.ts +10 -1
  115. package/dist/urls/index.js +24 -1
  116. package/package.json +60 -179
  117. package/dist/chunk-JYQTCICM.js +0 -1
  118. package/dist/chunk-YLA3DURS.cjs +0 -1
@@ -1 +1,113 @@
1
- import{isInteger as r}from"./chunk-WVSPXFTY.js";import{safeStableStringify as e}from"./chunk-PET42Z7W.js";import{getPreciseType as t,isNull as o}from"./chunk-CMW2TBOQ.js";var n=class extends Promise{_value;_error;_finish=[];constructor(r){let e,t;super((r,o)=>{e=r,t=o}),r(r=>{this._value=r,e(r),this._finish.forEach(e=>e(r,void 0))},r=>{this._error=r,t(r),this._finish.forEach(e=>e(void 0,r))}),Object.setPrototypeOf(this,new.target.prototype)}then(r,e){return super.then(r,e)}catch(r){return super.catch(r)}finish(r){return void 0!==this._value||void 0!==this._error?r(this._value,this._error):this._finish.push(r),this}},i=class extends Error{constructor(r="The operation was aborted",e="AbortError"){super(r),this.name=e}},s=(n=1e3,s)=>{if(!r(n)||n<=0)throw new TypeError(`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${t(n)}\`, with value: \`${e(n)}\`.`);if(o(s)||s&&!(s instanceof AbortSignal))throw new TypeError("Second parameter (`signal`) must be an `instance of AbortSignal` if provided.");return new Promise((r,e)=>{const t=setTimeout(()=>{o(),r()},n),o=()=>{clearTimeout(t),s&&s.removeEventListener("abort",a)},a=()=>{o(),e(new i("Function `delay` from `@rzl-zone/utils-js` was aborted.","AbortError"))};s&&(s.aborted?a():s.addEventListener("abort",a,{once:!0}))})};export{n as CustomPromise,s as delay};
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 };
@@ -1 +1,14 @@
1
- var t=t=>"bigint"==typeof t;export{t as isBigInt};
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 };
@@ -1 +1,417 @@
1
- import{isNonEmptyString as s}from"./chunk-CMW2TBOQ.js";var a=new Set(["txt","md","rtf","tex","doc","docx","odt","ott","pdf","djvu","epub","mobi","azw","azw3","xls","xlsx","ods","csv","tsv","ppt","pptx","odp","pps","md","bib","tex","log","jpg","jpeg","png","gif","bmp","tif","tiff","webp","svg","ico","heif","heic","raw","cr2","nef","orf","sr2","dng","dds","psd","exr","xcf","ai","eps","cdr","psd","indd","mp3","wav","ogg","flac","aac","m4a","wma","alac","aiff","amr","mid","midi","opus","au","caf","ape","opus","mp4","mkv","avi","mov","flv","wmv","webm","mpeg","mpg","3gp","3g2","m4v","ts","mts","asf","rm","rmvb","vob","f4v","ogv","m2ts","mod","dav","zip","rar","7z","tar","gz","bz2","xz","tgz","tbz2","txz","lz","lzma","z","cab","arj","ace","iso","dmg","rpm","deb","pkg","apk","jar","iso","img","vhd","vmdk","qcow2","dmg","sql","db","dbf","mdb","accdb","json","xml","yaml","yml","toml","ini","plist","yaml","pkl","msgpack","h5","hdf5","parquet","avro","orc","ndjson","db","pdb","sqlite","sqlite3","dbx","sdf","js","jsx","ts","tsx","c","cpp","h","hpp","java","py","rb","go","rs","php","pl","sh","bat","cmd","ps1","lua","swift","kt","scala","cs","vb","dart","m","r","jl","fs","vbproj","sln","pri","Makefile","html","htm","xhtml","css","scss","sass","less","xml","json","yaml","yml","xlf","xlf","po","pot","jsp","asp","aspx","php","jspf","cgi","cfm","pl","env","conf","config","xml","ini","cfg","toml","yaml","dockerfile","gitignore","gitconfig","gitattributes","npmignore","lock","gradle","pom","yaml","prettierrc","eslintrc","babelrc","editorconfig","ttf","otf","woff","woff2","eot","dwg","dxf","shp","kml","kmz","gpx","stl","step","iges","3ds","3dm","fbx","obj","exe","msi","bin","run","com","cmd","apk","app","deb","rpm","elf","dll","so","dylib","sys","pem","crt","cer","key","der","csr","p12","pfx","jks","iso","cue","bin","nes","sfc","gba","nds","nes","sav","rom","pak","vpk","bik","epub","mobi","azw","azw3","fb2","lit","lrf","cbr","cbz","cbt","cba","opds","fasta","fa","fas","ffn","faa","fna","frn","fastq","fq","gb","gbk","sam","bam","vcf","gff","bed","log","bak","tmp","old","backup","swp","part","crdownload","torrent","ics","vcf","ics","ical","ics","ical","calendar","srt","sub","idx","cue","cdf","hdf","h5","nc","grib","fits","netcdf","sdf","vtk","xmind","drawio","jar","war","ear","crx","xpi","plugin","vsix","safariextz"]),t=new Set(["tar.gz","tar.bz2","tar.xz","tar.lz","tar.lzma","tar.Z","tar.zst","tar.xz"]),r=r=>{if(!s(r))return;let p=r.split("/").pop();if(""===p)return"";if(p){for(const s of t){const a=`.${s}`;if(p.toLowerCase().endsWith(a))return p.slice(0,-a.length)}for(;;){const s=p.lastIndexOf(".");if(-1===s)break;const t=p.slice(s+1).toLowerCase();if(!a.has(t))break;p=p.slice(0,s)}return p}};export{r as extractFileName};
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 };
@@ -1 +1,116 @@
1
- "use strict";var e=require("./chunk-DVMHRLKP.cjs"),r=require("./chunk-T7PU2V7X.cjs"),t=require("./chunk-PZQ6I4JJ.cjs"),s=class extends Error{constructor(e="The operation was aborted",r="AbortError"){super(e),this.name=r}};exports.CustomPromise=class extends Promise{_value;_error;_finish=[];constructor(e){let r,t;super((e,s)=>{r=e,t=s}),e(e=>{this._value=e,r(e),this._finish.forEach(r=>r(e,void 0))},e=>{this._error=e,t(e),this._finish.forEach(r=>r(void 0,e))}),Object.setPrototypeOf(this,new.target.prototype)}then(e,r){return super.then(e,r)}catch(e){return super.catch(e)}finish(e){return void 0!==this._value||void 0!==this._error?e(this._value,this._error):this._finish.push(e),this}},exports.delay=(i=1e3,o)=>{if(!e.isInteger(i)||i<=0)throw new TypeError(`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${t.getPreciseType(i)}\`, with value: \`${r.safeStableStringify(i)}\`.`);if(t.isNull(o)||o&&!(o instanceof AbortSignal))throw new TypeError("Second parameter (`signal`) must be an `instance of AbortSignal` if provided.");return new Promise((e,r)=>{const t=setTimeout(()=>{n(),e()},i),n=()=>{clearTimeout(t),o&&o.removeEventListener("abort",a)},a=()=>{n(),r(new s("Function `delay` from `@rzl-zone/utils-js` was aborted.","AbortError"))};o&&(o.aborted?a():o.addEventListener("abort",a,{once:!0}))})};
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;