@e-mc/types 0.7.8 → 0.7.10
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/constant.d.ts +1 -1
- package/index.js +95 -160
- package/lib/compress.d.ts +5 -5
- package/package.json +1 -1
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errorValue = exports.validateUUID = exports.randomString = exports.decryptUTF8 = exports.encryptUTF8 = exports.getEncoding = exports.asFunction = exports.coerceObject = exports.cloneObject = exports.cascadeObject = exports.formatSize = exports.renameExt = exports.escapePattern = exports.hasGlob = exports.convertTime = exports.formatTime = exports.parseExpires = exports.parseTime = exports.isEmpty = exports.isString = exports.isObject = exports.isPlainObject = exports.isArray = exports.setTempDir = exports.getTempDir = exports.setLogCurrent = exports.getLogCurrent = exports.existsFlag = exports.mainFlag = exports.processFlag = exports.modifiedFlag = exports.watchFlag = exports.usingFlag = exports.cloneFlag = exports.ignoreFlag = exports.hasBit = exports.createAbortError = exports.IMPORT_MAP = exports.THRESHOLD = exports.READDIR_SORT = exports.WATCH_EVENT = exports.DB_TRANSACTION = exports.DB_TYPE = exports.FETCH_TYPE = exports.DOWNLOAD_TYPE = exports.ERR_CODE = exports.ASSET_FLAG = exports.FILE_TYPE = exports.STATUS_TYPE = exports.LOG_TYPE = void 0;
|
|
4
|
+
exports.generateUUID = exports.purgeMemory = exports.errorMessage = void 0;
|
|
4
5
|
const path = require("path");
|
|
5
6
|
const fs = require("fs");
|
|
6
7
|
const crypto = require("crypto");
|
|
8
|
+
const uuid = require("uuid");
|
|
7
9
|
const bytes = require("bytes");
|
|
8
10
|
class AbortError extends Error {
|
|
9
11
|
constructor() {
|
|
@@ -13,15 +15,11 @@ class AbortError extends Error {
|
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
const REGEXP_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
16
|
-
const REGEXP_FUNCTION = /^(async\s+)?(function(?:\b|\s+)[\w_$]
|
|
17
|
-
const REGEXP_FUNCTION_ARROW = /^(async\s+)?(\(([^)]*)\)\s*=>\s*(?:\{([\S\s]*)\}|(?!\s|{)((?:(?<!return\s+)(?:"[^"\n]*"|'[^'\n]*'|`[^`]*`|[^\n;"'`]))*;)))$/;
|
|
18
|
-
const REGEXP_GLOB = /(?<!\\)(?:(?:[^*]|^)\*{1,2}(?:[^*]|$)|\{[^}]+\}|\[[!^][^\]]+\]|[!?*+@]\([^)]+\))/;
|
|
18
|
+
const REGEXP_FUNCTION = /^(async\s+)?(function(?:\b|\s+)([\w_$]*)\s*\(([^)]*)\)\s*\{([\S\s]*)\})$/;
|
|
19
19
|
const ASYNC_FUNCTION = Object.getPrototypeOf(async () => { }).constructor;
|
|
20
20
|
let CACHE_COERCED = new WeakSet();
|
|
21
21
|
let LOG_CURRENT = null;
|
|
22
22
|
let TEMP_DIR = path.join(process.cwd(), "tmp");
|
|
23
|
-
let INCREMENT_COUNT = 65536;
|
|
24
|
-
let INCREMENT_PREFIX = '';
|
|
25
23
|
function fromObject(value, typedArray) {
|
|
26
24
|
if (isObject(value)) {
|
|
27
25
|
if (value instanceof Map) {
|
|
@@ -236,12 +234,6 @@ var DB_TRANSACTION;
|
|
|
236
234
|
DB_TRANSACTION[DB_TRANSACTION["AUTH"] = 64] = "AUTH";
|
|
237
235
|
DB_TRANSACTION[DB_TRANSACTION["CACHE"] = 128] = "CACHE";
|
|
238
236
|
})(DB_TRANSACTION || (exports.DB_TRANSACTION = DB_TRANSACTION = {}));
|
|
239
|
-
var TRANSFER_TYPE;
|
|
240
|
-
(function (TRANSFER_TYPE) {
|
|
241
|
-
TRANSFER_TYPE[TRANSFER_TYPE["DISK"] = 1] = "DISK";
|
|
242
|
-
TRANSFER_TYPE[TRANSFER_TYPE["STREAM"] = 2] = "STREAM";
|
|
243
|
-
TRANSFER_TYPE[TRANSFER_TYPE["CHUNK"] = 4] = "CHUNK";
|
|
244
|
-
})(TRANSFER_TYPE || (exports.TRANSFER_TYPE = TRANSFER_TYPE = {}));
|
|
245
237
|
var WATCH_EVENT;
|
|
246
238
|
(function (WATCH_EVENT) {
|
|
247
239
|
WATCH_EVENT["MODIFIED"] = "modified";
|
|
@@ -341,9 +333,8 @@ var IMPORT_MAP;
|
|
|
341
333
|
IMPORT_MAP["@squared-functions/document/packages/terser"] = "@pi-r/terser";
|
|
342
334
|
IMPORT_MAP["@squared-functions/document/packages/uglify-js"] = "@pi-r/uglify-js";
|
|
343
335
|
})(IMPORT_MAP || (exports.IMPORT_MAP = IMPORT_MAP = {}));
|
|
344
|
-
function createAbortError(
|
|
345
|
-
|
|
346
|
-
return (reject ? Promise.reject(result) : result);
|
|
336
|
+
function createAbortError() {
|
|
337
|
+
return new AbortError();
|
|
347
338
|
}
|
|
348
339
|
exports.createAbortError = createAbortError;
|
|
349
340
|
function hasBit(value, flags) {
|
|
@@ -411,7 +402,7 @@ function isArray(value) {
|
|
|
411
402
|
}
|
|
412
403
|
exports.isArray = isArray;
|
|
413
404
|
function isPlainObject(value) {
|
|
414
|
-
return typeof value === 'object'
|
|
405
|
+
return value && typeof value === 'object' ? value.constructor === Object || Object.getPrototypeOf(value) === null : false;
|
|
415
406
|
}
|
|
416
407
|
exports.isPlainObject = isPlainObject;
|
|
417
408
|
function isObject(value) {
|
|
@@ -429,8 +420,9 @@ exports.isEmpty = isEmpty;
|
|
|
429
420
|
function parseTime(value, start = 0) {
|
|
430
421
|
const seconds = +value;
|
|
431
422
|
if (isNaN(seconds) && isString(value)) {
|
|
432
|
-
|
|
433
|
-
|
|
423
|
+
const pattern = /\b([\d.]+)\s*(y|M|w|d|h|ms?|s)\b/g;
|
|
424
|
+
let result = 0, match = null;
|
|
425
|
+
while (match = pattern.exec(value.toLowerCase())) {
|
|
434
426
|
const n = +match[1];
|
|
435
427
|
if (isNaN(n)) {
|
|
436
428
|
continue;
|
|
@@ -490,13 +482,13 @@ function formatTime(value, elapsed, char = ' ') {
|
|
|
490
482
|
if (value < 1000) {
|
|
491
483
|
return value + 'ms';
|
|
492
484
|
}
|
|
493
|
-
|
|
494
|
-
|
|
485
|
+
const h = Math.floor(value / 3600000);
|
|
486
|
+
if (h > 0) {
|
|
495
487
|
value -= h * 3600000;
|
|
496
488
|
result.push(h + 'h');
|
|
497
489
|
}
|
|
498
|
-
|
|
499
|
-
|
|
490
|
+
const m = Math.floor(value / 60000);
|
|
491
|
+
if (m > 0) {
|
|
500
492
|
value -= m * 60000;
|
|
501
493
|
result.push(m + 'm');
|
|
502
494
|
}
|
|
@@ -507,19 +499,15 @@ function formatTime(value, elapsed, char = ' ') {
|
|
|
507
499
|
}
|
|
508
500
|
exports.formatTime = formatTime;
|
|
509
501
|
function convertTime(value, format) {
|
|
510
|
-
let result;
|
|
511
502
|
if (Array.isArray(value)) {
|
|
512
|
-
const
|
|
513
|
-
|
|
503
|
+
const result = Math.ceil((value[0] * 1000000000 + value[1]) / 1000000);
|
|
504
|
+
return format ? formatTime(result) : result;
|
|
514
505
|
}
|
|
515
|
-
|
|
516
|
-
result = parseTime(value);
|
|
517
|
-
}
|
|
518
|
-
return result;
|
|
506
|
+
return parseTime(value);
|
|
519
507
|
}
|
|
520
508
|
exports.convertTime = convertTime;
|
|
521
509
|
function hasGlob(value) {
|
|
522
|
-
return
|
|
510
|
+
return /(?<!\\)(?:(?:[^*]|^)\*{1,2}(?:[^*]|$)|\{[^}]+\}|\[[!^][^\]]+\]|[!?*+@]\([^)]+\))/.test(value);
|
|
523
511
|
}
|
|
524
512
|
exports.hasGlob = hasGlob;
|
|
525
513
|
function escapePattern(value, lookBehind) {
|
|
@@ -581,46 +569,11 @@ function renameExt(value, ext, when) {
|
|
|
581
569
|
}
|
|
582
570
|
exports.renameExt = renameExt;
|
|
583
571
|
function formatSize(value, options) {
|
|
584
|
-
|
|
585
|
-
if (typeof value === 'number') {
|
|
586
|
-
result = bytes(value, options) || ('0' + (options?.unitSeparator || '') + 'B');
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
result = bytes(value) || 0;
|
|
590
|
-
}
|
|
591
|
-
return result;
|
|
572
|
+
return (typeof value === 'number' ? bytes(value, options) : bytes(value));
|
|
592
573
|
}
|
|
593
574
|
exports.formatSize = formatSize;
|
|
594
|
-
function alignSize(value, kb = 0, factor = 0) {
|
|
595
|
-
if (value === undefined) {
|
|
596
|
-
return NaN;
|
|
597
|
-
}
|
|
598
|
-
let result = 0;
|
|
599
|
-
switch (typeof value) {
|
|
600
|
-
case 'number':
|
|
601
|
-
if (value < 0) {
|
|
602
|
-
return NaN;
|
|
603
|
-
}
|
|
604
|
-
result = Math.ceil(factor > 0 ? value * Math.pow(1024, factor) : value);
|
|
605
|
-
break;
|
|
606
|
-
case 'string':
|
|
607
|
-
result = formatSize(value);
|
|
608
|
-
if (result < 0) {
|
|
609
|
-
return NaN;
|
|
610
|
-
}
|
|
611
|
-
break;
|
|
612
|
-
default:
|
|
613
|
-
return NaN;
|
|
614
|
-
}
|
|
615
|
-
if (kb > 0) {
|
|
616
|
-
kb = Math.ceil(kb) * 1024;
|
|
617
|
-
return Math.ceil(result / kb) * kb;
|
|
618
|
-
}
|
|
619
|
-
return result;
|
|
620
|
-
}
|
|
621
|
-
exports.alignSize = alignSize;
|
|
622
575
|
function cascadeObject(data, query, fallback) {
|
|
623
|
-
if (isObject(data)) {
|
|
576
|
+
if (isObject(data) && isString(query)) {
|
|
624
577
|
const names = query.trim().split(/(?<!\\)\./).map(item => item.includes('.') ? item.replace(/\\(?=\.)/g, '') : item);
|
|
625
578
|
for (let i = 0, length = names.length, match, current = data; i < length; ++i) {
|
|
626
579
|
if (!(match = /^(.+?)(?:\[(.+)\])?$/.exec(names[i]))) {
|
|
@@ -753,16 +706,16 @@ function coerceObject(data, parseString, cache) {
|
|
|
753
706
|
}
|
|
754
707
|
if (!parseString) {
|
|
755
708
|
parseString = (value) => {
|
|
756
|
-
if (value.length
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
709
|
+
if (value.length > 8) {
|
|
710
|
+
switch (value.substring(0, 3)) {
|
|
711
|
+
case 'new': {
|
|
712
|
+
const match = /^new\s+(Date|RegExp|URL|Map|WeakMap|Set|WeakSet)\(([\S\s]*)\)$/.exec(value.trimEnd());
|
|
713
|
+
if (!match) {
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
763
716
|
try {
|
|
764
717
|
const removeQuotes = (content) => content.trim().replace(/^["']/g, '').replace(/["']$/g, '').trim();
|
|
765
|
-
const errorCreate = () => errorValue(
|
|
718
|
+
const errorCreate = () => errorValue('Invalid parameters', match[2].trim());
|
|
766
719
|
switch (match[1]) {
|
|
767
720
|
case 'Date':
|
|
768
721
|
return new Date(match[2].replace(/["']/g, '').trim());
|
|
@@ -799,39 +752,39 @@ function coerceObject(data, parseString, cache) {
|
|
|
799
752
|
catch {
|
|
800
753
|
return undefined;
|
|
801
754
|
}
|
|
755
|
+
break;
|
|
802
756
|
}
|
|
803
|
-
|
|
757
|
+
case 'asy':
|
|
758
|
+
if (value.substring(3, 5) === 'nc') {
|
|
759
|
+
return asFunction(value);
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
case 'fun':
|
|
763
|
+
if (value.substring(3, 8) === 'ction') {
|
|
764
|
+
return asFunction(value);
|
|
765
|
+
}
|
|
766
|
+
break;
|
|
767
|
+
case 'Num':
|
|
768
|
+
switch (value) {
|
|
769
|
+
case 'Number.EPSILON':
|
|
770
|
+
return Number.EPSILON;
|
|
771
|
+
case 'Number.MAX_SAFE_INTEGER':
|
|
772
|
+
return Number.MAX_SAFE_INTEGER;
|
|
773
|
+
case 'Number.MAX_VALUE':
|
|
774
|
+
return Number.MAX_VALUE;
|
|
775
|
+
case 'Number.MIN_SAFE_INTEGER':
|
|
776
|
+
return Number.MIN_SAFE_INTEGER;
|
|
777
|
+
case 'Number.MIN_VALUE':
|
|
778
|
+
return Number.MIN_VALUE;
|
|
779
|
+
case 'Number.NaN':
|
|
780
|
+
return Number.NaN;
|
|
781
|
+
case 'Number.NEGATIVE_INFINITY':
|
|
782
|
+
return Number.NEGATIVE_INFINITY;
|
|
783
|
+
case 'Number.POSITIVE_INFINITY':
|
|
784
|
+
return Number.POSITIVE_INFINITY;
|
|
785
|
+
}
|
|
786
|
+
break;
|
|
804
787
|
}
|
|
805
|
-
case 'asy':
|
|
806
|
-
if (value.substring(3, 5) === 'nc') {
|
|
807
|
-
return asFunction(value);
|
|
808
|
-
}
|
|
809
|
-
break;
|
|
810
|
-
case 'fun':
|
|
811
|
-
if (value.substring(3, 8) === 'ction') {
|
|
812
|
-
return asFunction(value);
|
|
813
|
-
}
|
|
814
|
-
break;
|
|
815
|
-
case 'Num':
|
|
816
|
-
switch (value) {
|
|
817
|
-
case 'Number.EPSILON':
|
|
818
|
-
return Number.EPSILON;
|
|
819
|
-
case 'Number.MAX_SAFE_INTEGER':
|
|
820
|
-
return Number.MAX_SAFE_INTEGER;
|
|
821
|
-
case 'Number.MAX_VALUE':
|
|
822
|
-
return Number.MAX_VALUE;
|
|
823
|
-
case 'Number.MIN_SAFE_INTEGER':
|
|
824
|
-
return Number.MIN_SAFE_INTEGER;
|
|
825
|
-
case 'Number.MIN_VALUE':
|
|
826
|
-
return Number.MIN_VALUE;
|
|
827
|
-
case 'Number.NaN':
|
|
828
|
-
return Number.NaN;
|
|
829
|
-
case 'Number.NEGATIVE_INFINITY':
|
|
830
|
-
return Number.NEGATIVE_INFINITY;
|
|
831
|
-
case 'Number.POSITIVE_INFINITY':
|
|
832
|
-
return Number.POSITIVE_INFINITY;
|
|
833
|
-
}
|
|
834
|
-
break;
|
|
835
788
|
}
|
|
836
789
|
return null;
|
|
837
790
|
};
|
|
@@ -850,10 +803,10 @@ function asFunction(value, sync = true) {
|
|
|
850
803
|
return value;
|
|
851
804
|
}
|
|
852
805
|
let match;
|
|
853
|
-
if (isString(value) && (match = REGEXP_FUNCTION.exec(value = value.trim())
|
|
806
|
+
if (isString(value) && (match = REGEXP_FUNCTION.exec(value = value.trim()))) {
|
|
854
807
|
if (!sync || match[1]) {
|
|
855
|
-
const args = match[
|
|
856
|
-
args.push(match[
|
|
808
|
+
const args = match[4].trim().split(/\s*,\s*/);
|
|
809
|
+
args.push(match[5]);
|
|
857
810
|
return new ASYNC_FUNCTION(...args);
|
|
858
811
|
}
|
|
859
812
|
try {
|
|
@@ -869,22 +822,7 @@ function asFunction(value, sync = true) {
|
|
|
869
822
|
}
|
|
870
823
|
exports.asFunction = asFunction;
|
|
871
824
|
function getEncoding(value, fallback = 'utf-8') {
|
|
872
|
-
|
|
873
|
-
switch (value = value.trim().toLowerCase()) {
|
|
874
|
-
case 'utf8':
|
|
875
|
-
case 'utf-8':
|
|
876
|
-
case 'utf16le':
|
|
877
|
-
return value;
|
|
878
|
-
case 'utf-16le':
|
|
879
|
-
case 'utf16':
|
|
880
|
-
case 'utf-16':
|
|
881
|
-
return 'utf16le';
|
|
882
|
-
}
|
|
883
|
-
if (Buffer.isEncoding(value)) {
|
|
884
|
-
return value;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
return fallback;
|
|
825
|
+
return typeof value === 'string' && Buffer.isEncoding(value = value.trim().toLowerCase()) ? value : fallback;
|
|
888
826
|
}
|
|
889
827
|
exports.getEncoding = getEncoding;
|
|
890
828
|
function encryptUTF8(algorithm, key, iv, data, encoding = 'hex') {
|
|
@@ -913,35 +851,40 @@ function randomString(format, dictionary) {
|
|
|
913
851
|
if (format !== '8-4-4-4-12' || dictionary) {
|
|
914
852
|
const match = format.match(/(\d+|[^\d]+)/g);
|
|
915
853
|
if (match) {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
else {
|
|
924
|
-
if (isNaN(length = +b)) {
|
|
925
|
-
return a + b;
|
|
854
|
+
try {
|
|
855
|
+
dictionary || (dictionary = '0123456789abcdef');
|
|
856
|
+
const result = format.match(/(\d+|[^\d[]+|\[[^\]]+\]|\[)/g).reduce((a, b) => {
|
|
857
|
+
let length, available;
|
|
858
|
+
if (b.startsWith('[') && b.endsWith(']')) {
|
|
859
|
+
length = 1;
|
|
860
|
+
available = b.substring(1, b.length - 1);
|
|
926
861
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
if (isFunction(crypto.getRandomValues) && length > 1 && length <= 65536) {
|
|
931
|
-
const items = crypto.getRandomValues(new Uint32Array(length));
|
|
932
|
-
for (let i = 0; i < length; i++) {
|
|
933
|
-
a += available[items[i] % upperBound];
|
|
862
|
+
else {
|
|
863
|
+
length = +b;
|
|
864
|
+
available = dictionary;
|
|
934
865
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
866
|
+
if (!isNaN(length)) {
|
|
867
|
+
const j = available.length;
|
|
868
|
+
if (isFunction(crypto.getRandomValues) && length > 1) {
|
|
869
|
+
const items = crypto.getRandomValues(new Uint32Array(length));
|
|
870
|
+
for (let i = 0; i < length; i++) {
|
|
871
|
+
a += available[items[i] % j];
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
for (let i = 0; i < length; ++i) {
|
|
876
|
+
a += available[Math.floor(Math.random() * j)];
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
return a;
|
|
939
880
|
}
|
|
881
|
+
return a + b;
|
|
882
|
+
}, '');
|
|
883
|
+
if (result) {
|
|
884
|
+
return result;
|
|
940
885
|
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
if (result) {
|
|
944
|
-
return result;
|
|
886
|
+
}
|
|
887
|
+
catch {
|
|
945
888
|
}
|
|
946
889
|
}
|
|
947
890
|
}
|
|
@@ -964,12 +907,4 @@ function purgeMemory(percent) {
|
|
|
964
907
|
CACHE_COERCED = new WeakSet();
|
|
965
908
|
}
|
|
966
909
|
exports.purgeMemory = purgeMemory;
|
|
967
|
-
function
|
|
968
|
-
if (restart || INCREMENT_COUNT === 65536) {
|
|
969
|
-
INCREMENT_COUNT = 0;
|
|
970
|
-
INCREMENT_PREFIX = (0, exports.generateUUID)().substring(0, 33);
|
|
971
|
-
}
|
|
972
|
-
return INCREMENT_PREFIX + (INCREMENT_COUNT++).toString(16).padStart(4, '0');
|
|
973
|
-
}
|
|
974
|
-
exports.incrementUUID = incrementUUID;
|
|
975
|
-
exports.generateUUID = crypto.randomUUID.bind(crypto);
|
|
910
|
+
exports.generateUUID = typeof crypto.randomUUID === 'function' ? crypto.randomUUID.bind(crypto) : uuid.v4;
|
package/lib/compress.d.ts
CHANGED
|
@@ -2,21 +2,21 @@ import type { CompressFormat as ICompressFormat } from './squared';
|
|
|
2
2
|
|
|
3
3
|
import type { LogBaseOptions, LogTime } from './logger';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type ResultCallback<T = Null<Buffer | Uint8Array>> = (err: unknown, data?: T, ext?: string) => void;
|
|
6
|
+
type ResultData = Null<Buffer | Uint8Array> | string;
|
|
7
|
+
|
|
8
|
+
export interface CompressFormat extends ICompressFormat, LogBaseOptions {
|
|
6
9
|
filename?: string;
|
|
7
10
|
startTime?: LogTime;
|
|
8
11
|
etag?: string;
|
|
9
12
|
proxyUrl?: string | ((uri: string) => Undef<string>);
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
interface Woff {
|
|
15
|
+
export interface Woff {
|
|
13
16
|
toWoff(this: void, data: BufferLike): Buffer;
|
|
14
17
|
toSfnt(this: void, data: BufferLike): Buffer;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
type ResultCallback<T = Null<Buffer | Uint8Array>> = (err: unknown, data?: T, ext?: string) => void;
|
|
18
|
-
type ResultData = Null<Buffer | Uint8Array> | string;
|
|
19
|
-
|
|
20
20
|
export type BufferLike = Buffer | Uint8Array | ArrayBuffer | SharedArrayBuffer | readonly number[];
|
|
21
21
|
export type TryFileCompressor = (data: string | Buffer, output: string, config: CompressFormat, callback?: TryFileResult) => Void<Promise<ResultData>>;
|
|
22
22
|
export type TryFileCompressorAsync = (data: string | Buffer, output: string, config: CompressFormat) => Promise<ResultData>;
|