@powfix/core-js 0.22.2 → 0.23.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/dist/browser/index.cjs +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +0 -0
- package/dist/chunk-ETV4XYOV.cjs +18 -0
- package/dist/chunk-PKBMQBKP.js +17 -0
- package/dist/index.browser.cjs +16 -1726
- package/dist/index.browser.d.ts +57 -484
- package/dist/index.browser.js +2 -1644
- package/dist/index.cjs +8 -1727
- package/dist/index.d.ts +52 -1
- package/dist/index.js +1 -1644
- package/dist/index.node.cjs +15 -2123
- package/dist/index.node.d.ts +77 -164
- package/dist/index.node.js +2 -2034
- package/dist/nodejs/constants/TransactionManagerLogLevel.cjs +11 -0
- package/dist/nodejs/constants/TransactionManagerLogLevel.d.ts +9 -0
- package/dist/nodejs/constants/TransactionManagerLogLevel.js +10 -0
- package/dist/nodejs/constants/TransactionManagerTimeoutAction.cjs +8 -0
- package/dist/nodejs/constants/TransactionManagerTimeoutAction.d.ts +6 -0
- package/dist/nodejs/constants/TransactionManagerTimeoutAction.js +7 -0
- package/dist/nodejs/constants/index.cjs +19 -0
- package/dist/nodejs/constants/index.d.ts +2 -0
- package/dist/nodejs/constants/index.js +2 -0
- package/dist/nodejs/index.cjs +55 -0
- package/dist/nodejs/index.d.ts +25 -0
- package/dist/nodejs/index.js +6 -0
- package/dist/nodejs/interfaces/db/index.cjs +10 -0
- package/dist/nodejs/interfaces/db/index.d.ts +10 -0
- package/dist/nodejs/interfaces/db/index.js +1 -0
- package/dist/nodejs/interfaces/db/sequelize/Hook.cjs +1 -0
- package/dist/nodejs/interfaces/db/sequelize/Hook.d.ts +13 -0
- package/dist/nodejs/interfaces/db/sequelize/Hook.js +0 -0
- package/dist/nodejs/interfaces/db/sequelize/HookFn.cjs +1 -0
- package/dist/nodejs/interfaces/db/sequelize/HookFn.d.ts +7 -0
- package/dist/nodejs/interfaces/db/sequelize/HookFn.js +0 -0
- package/dist/nodejs/interfaces/db/sequelize/HookType.cjs +1 -0
- package/dist/nodejs/interfaces/db/sequelize/HookType.d.ts +6 -0
- package/dist/nodejs/interfaces/db/sequelize/HookType.js +0 -0
- package/dist/nodejs/interfaces/db/sequelize/ReloadOption.cjs +1 -0
- package/dist/nodejs/interfaces/db/sequelize/ReloadOption.d.ts +5 -0
- package/dist/nodejs/interfaces/db/sequelize/ReloadOption.js +0 -0
- package/dist/nodejs/interfaces/db/sequelize/TransactionOption.cjs +1 -0
- package/dist/nodejs/interfaces/db/sequelize/TransactionOption.d.ts +7 -0
- package/dist/nodejs/interfaces/db/sequelize/TransactionOption.js +0 -0
- package/dist/nodejs/interfaces/db/sequelize/UpsertOptions.cjs +1 -0
- package/dist/nodejs/interfaces/db/sequelize/UpsertOptions.d.ts +8 -0
- package/dist/nodejs/interfaces/db/sequelize/UpsertOptions.js +0 -0
- package/dist/nodejs/interfaces/db/sequelize/index.cjs +55 -0
- package/dist/nodejs/interfaces/db/sequelize/index.d.ts +10 -0
- package/dist/nodejs/interfaces/db/sequelize/index.js +6 -0
- package/dist/nodejs/interfaces/index.cjs +10 -0
- package/dist/nodejs/interfaces/index.d.ts +10 -0
- package/dist/nodejs/interfaces/index.js +1 -0
- package/dist/nodejs/managers/TransactionManager.cjs +463 -0
- package/dist/nodejs/managers/TransactionManager.d.ts +31 -0
- package/dist/nodejs/managers/TransactionManager.js +457 -0
- package/dist/nodejs/managers/TransactionManager.types.cjs +1 -0
- package/dist/nodejs/managers/TransactionManager.types.d.ts +12 -0
- package/dist/nodejs/managers/TransactionManager.types.js +0 -0
- package/dist/nodejs/managers/index.cjs +19 -0
- package/dist/nodejs/managers/index.d.ts +6 -0
- package/dist/nodejs/managers/index.js +2 -0
- package/dist/nodejs/services/index.cjs +10 -0
- package/dist/nodejs/services/index.d.ts +5 -0
- package/dist/nodejs/services/index.js +1 -0
- package/dist/nodejs/services/redis/RedisClient.cjs +250 -0
- package/dist/nodejs/services/redis/RedisClient.d.ts +24 -0
- package/dist/nodejs/services/redis/RedisClient.js +250 -0
- package/dist/nodejs/services/redis/RedisPublisher.cjs +323 -0
- package/dist/nodejs/services/redis/RedisPublisher.d.ts +17 -0
- package/dist/nodejs/services/redis/RedisPublisher.js +323 -0
- package/dist/nodejs/services/redis/RedisSubscriber.cjs +502 -0
- package/dist/nodejs/services/redis/RedisSubscriber.d.ts +15 -0
- package/dist/nodejs/services/redis/RedisSubscriber.js +502 -0
- package/dist/nodejs/services/redis/index.cjs +28 -0
- package/dist/nodejs/services/redis/index.d.ts +5 -0
- package/dist/nodejs/services/redis/index.js +3 -0
- package/dist/nodejs/types/UpsertResult.cjs +1 -0
- package/dist/nodejs/types/UpsertResult.d.ts +5 -0
- package/dist/nodejs/types/UpsertResult.js +0 -0
- package/dist/nodejs/types/index.cjs +19 -0
- package/dist/nodejs/types/index.d.ts +9 -0
- package/dist/nodejs/types/index.js +2 -0
- package/dist/nodejs/types/mariaDb.cjs +1 -0
- package/dist/nodejs/types/mariaDb.d.ts +15 -0
- package/dist/nodejs/types/mariaDb.js +0 -0
- package/dist/nodejs/utils/HookUtils.cjs +87 -0
- package/dist/nodejs/utils/HookUtils.d.ts +20 -0
- package/dist/nodejs/utils/HookUtils.js +87 -0
- package/dist/nodejs/utils/index.cjs +19 -0
- package/dist/nodejs/utils/index.d.ts +10 -0
- package/dist/nodejs/utils/index.js +2 -0
- package/dist/nodejs/utils/sequelize-utils/SequelizeUtils.cjs +165 -0
- package/dist/nodejs/utils/sequelize-utils/SequelizeUtils.d.ts +12 -0
- package/dist/nodejs/utils/sequelize-utils/SequelizeUtils.js +165 -0
- package/dist/nodejs/utils/sequelize-utils/index.cjs +19 -0
- package/dist/nodejs/utils/sequelize-utils/index.d.ts +3 -0
- package/dist/nodejs/utils/sequelize-utils/index.js +2 -0
- package/dist/nodejs/utils/sequelize-utils/types.cjs +1 -0
- package/dist/nodejs/utils/sequelize-utils/types.d.ts +19 -0
- package/dist/nodejs/utils/sequelize-utils/types.js +0 -0
- package/dist/shared/constants/COORDINATE.cjs +15 -0
- package/dist/shared/constants/COORDINATE.d.ts +9 -0
- package/dist/shared/constants/COORDINATE.js +15 -0
- package/dist/shared/constants/CRUD.cjs +26 -0
- package/dist/shared/constants/CRUD.d.ts +11 -0
- package/dist/shared/constants/CRUD.js +26 -0
- package/dist/shared/constants/DATE.cjs +34 -0
- package/dist/shared/constants/DATE.d.ts +15 -0
- package/dist/shared/constants/DATE.js +34 -0
- package/dist/shared/constants/DISTANCE.cjs +22 -0
- package/dist/shared/constants/DISTANCE.d.ts +15 -0
- package/dist/shared/constants/DISTANCE.js +22 -0
- package/dist/shared/constants/DURATION.cjs +25 -0
- package/dist/shared/constants/DURATION.d.ts +18 -0
- package/dist/shared/constants/DURATION.js +25 -0
- package/dist/shared/constants/NOT_NULL.cjs +4 -0
- package/dist/shared/constants/NOT_NULL.d.ts +3 -0
- package/dist/shared/constants/NOT_NULL.js +3 -0
- package/dist/shared/constants/index.cjs +55 -0
- package/dist/shared/constants/index.d.ts +6 -0
- package/dist/shared/constants/index.js +6 -0
- package/dist/shared/exports/Uint8Array.cjs +9 -0
- package/dist/shared/exports/Uint8Array.d.ts +6 -0
- package/dist/shared/exports/Uint8Array.js +8 -0
- package/dist/shared/exports/atob.cjs +3 -0
- package/dist/shared/exports/atob.d.ts +2 -0
- package/dist/shared/exports/atob.js +2 -0
- package/dist/shared/exports/btoa.cjs +3 -0
- package/dist/shared/exports/btoa.d.ts +2 -0
- package/dist/shared/exports/btoa.js +2 -0
- package/dist/shared/index.cjs +64 -0
- package/dist/shared/index.d.ts +57 -0
- package/dist/shared/index.js +7 -0
- package/dist/shared/interfaces/Coordinate.cjs +1 -0
- package/dist/shared/interfaces/Coordinate.d.ts +10 -0
- package/dist/shared/interfaces/Coordinate.js +0 -0
- package/dist/shared/interfaces/Point2.cjs +1 -0
- package/dist/shared/interfaces/Point2.d.ts +6 -0
- package/dist/shared/interfaces/Point2.js +0 -0
- package/dist/shared/interfaces/Point3.cjs +1 -0
- package/dist/shared/interfaces/Point3.d.ts +7 -0
- package/dist/shared/interfaces/Point3.js +0 -0
- package/dist/shared/interfaces/StorageProvider.cjs +1 -0
- package/dist/shared/interfaces/StorageProvider.d.ts +9 -0
- package/dist/shared/interfaces/StorageProvider.js +0 -0
- package/dist/shared/interfaces/index.cjs +37 -0
- package/dist/shared/interfaces/index.d.ts +4 -0
- package/dist/shared/interfaces/index.js +4 -0
- package/dist/shared/managers/SessionManager.cjs +498 -0
- package/dist/shared/managers/SessionManager.d.ts +18 -0
- package/dist/shared/managers/SessionManager.js +491 -0
- package/dist/shared/managers/SessionManager.type.cjs +1 -0
- package/dist/shared/managers/SessionManager.type.d.ts +12 -0
- package/dist/shared/managers/SessionManager.type.js +0 -0
- package/dist/shared/managers/index.cjs +19 -0
- package/dist/shared/managers/index.d.ts +5 -0
- package/dist/shared/managers/index.js +2 -0
- package/dist/shared/scripts/base64Polyfill.cjs +20 -0
- package/dist/shared/scripts/base64Polyfill.d.ts +3 -0
- package/dist/shared/scripts/base64Polyfill.js +13 -0
- package/dist/shared/scripts/index.cjs +10 -0
- package/dist/shared/scripts/index.d.ts +1 -0
- package/dist/shared/scripts/index.js +1 -0
- package/dist/shared/services/index.cjs +10 -0
- package/dist/shared/services/index.d.ts +3 -0
- package/dist/shared/services/index.js +1 -0
- package/dist/shared/services/time/TimeService.cjs +487 -0
- package/dist/shared/services/time/TimeService.d.ts +34 -0
- package/dist/shared/services/time/TimeService.js +481 -0
- package/dist/shared/services/time/TimeService.type.cjs +1 -0
- package/dist/shared/services/time/TimeService.type.d.ts +23 -0
- package/dist/shared/services/time/TimeService.type.js +0 -0
- package/dist/shared/services/time/index.cjs +19 -0
- package/dist/shared/services/time/index.d.ts +3 -0
- package/dist/shared/services/time/index.js +2 -0
- package/dist/shared/types/IntRage.cjs +1 -0
- package/dist/shared/types/IntRage.d.ts +4 -0
- package/dist/shared/types/IntRage.js +0 -0
- package/dist/shared/types/PartialExcept.cjs +1 -0
- package/dist/shared/types/PartialExcept.d.ts +3 -0
- package/dist/shared/types/PartialExcept.js +0 -0
- package/dist/shared/types/index.cjs +19 -0
- package/dist/shared/types/index.d.ts +2 -0
- package/dist/shared/types/index.js +2 -0
- package/dist/shared/utils/ArrayUtils.cjs +104 -0
- package/dist/shared/utils/ArrayUtils.d.ts +14 -0
- package/dist/shared/utils/ArrayUtils.js +104 -0
- package/dist/shared/utils/AxiosUtils.cjs +113 -0
- package/dist/shared/utils/AxiosUtils.d.ts +8 -0
- package/dist/shared/utils/AxiosUtils.js +113 -0
- package/dist/shared/utils/BooleanUtils.cjs +7 -0
- package/dist/shared/utils/BooleanUtils.d.ts +3 -0
- package/dist/shared/utils/BooleanUtils.js +6 -0
- package/dist/shared/utils/Calc.cjs +62 -0
- package/dist/shared/utils/Calc.d.ts +6 -0
- package/dist/shared/utils/Calc.js +62 -0
- package/dist/shared/utils/CoordinateUtils.cjs +85 -0
- package/dist/shared/utils/CoordinateUtils.d.ts +11 -0
- package/dist/shared/utils/CoordinateUtils.js +85 -0
- package/dist/shared/utils/DateUtils.cjs +656 -0
- package/dist/shared/utils/DateUtils.d.ts +27 -0
- package/dist/shared/utils/DateUtils.js +651 -0
- package/dist/shared/utils/Enum.cjs +142 -0
- package/dist/shared/utils/Enum.d.ts +19 -0
- package/dist/shared/utils/Enum.js +142 -0
- package/dist/shared/utils/Enum.types.cjs +1 -0
- package/dist/shared/utils/Enum.types.d.ts +7 -0
- package/dist/shared/utils/Enum.types.js +0 -0
- package/dist/shared/utils/I18nUtils.cjs +48 -0
- package/dist/shared/utils/I18nUtils.d.ts +7 -0
- package/dist/shared/utils/I18nUtils.js +42 -0
- package/dist/shared/utils/JuminNumberUtils.cjs +71 -0
- package/dist/shared/utils/JuminNumberUtils.d.ts +6 -0
- package/dist/shared/utils/JuminNumberUtils.js +71 -0
- package/dist/shared/utils/NumberUtils.cjs +80 -0
- package/dist/shared/utils/NumberUtils.d.ts +6 -0
- package/dist/shared/utils/NumberUtils.js +80 -0
- package/dist/shared/utils/ObjectIdUtils.cjs +65 -0
- package/dist/shared/utils/ObjectIdUtils.d.ts +6 -0
- package/dist/shared/utils/ObjectIdUtils.js +65 -0
- package/dist/shared/utils/Point3Utils.cjs +39 -0
- package/dist/shared/utils/Point3Utils.d.ts +8 -0
- package/dist/shared/utils/Point3Utils.js +39 -0
- package/dist/shared/utils/RandomUtils.cjs +103 -0
- package/dist/shared/utils/RandomUtils.d.ts +10 -0
- package/dist/shared/utils/RandomUtils.js +103 -0
- package/dist/shared/utils/Sequencer.cjs +476 -0
- package/dist/shared/utils/Sequencer.d.ts +41 -0
- package/dist/shared/utils/Sequencer.js +467 -0
- package/dist/shared/utils/StringUtils.cjs +71 -0
- package/dist/shared/utils/StringUtils.d.ts +7 -0
- package/dist/shared/utils/StringUtils.js +71 -0
- package/dist/shared/utils/Uint8ArrayUtils.cjs +48 -0
- package/dist/shared/utils/Uint8ArrayUtils.d.ts +6 -0
- package/dist/shared/utils/Uint8ArrayUtils.js +48 -0
- package/dist/shared/utils/UuidUtils.cjs +95 -0
- package/dist/shared/utils/UuidUtils.d.ts +16 -0
- package/dist/shared/utils/UuidUtils.js +75 -0
- package/dist/shared/utils/Validator.cjs +135 -0
- package/dist/shared/utils/Validator.d.ts +50 -0
- package/dist/shared/utils/Validator.js +135 -0
- package/dist/shared/utils/global/atob.cjs +12 -0
- package/dist/shared/utils/global/atob.d.ts +5 -0
- package/dist/shared/utils/global/atob.js +5 -0
- package/dist/shared/utils/global/base64.cjs +42 -0
- package/dist/shared/utils/global/base64.d.ts +4 -0
- package/dist/shared/utils/global/base64.js +40 -0
- package/dist/shared/utils/global/between.cjs +6 -0
- package/dist/shared/utils/global/between.d.ts +3 -0
- package/dist/shared/utils/global/between.js +5 -0
- package/dist/shared/utils/global/btoa.cjs +12 -0
- package/dist/shared/utils/global/btoa.d.ts +5 -0
- package/dist/shared/utils/global/btoa.js +5 -0
- package/dist/shared/utils/global/castArray.cjs +8 -0
- package/dist/shared/utils/global/castArray.d.ts +3 -0
- package/dist/shared/utils/global/castArray.js +7 -0
- package/dist/shared/utils/global/circularDistance.cjs +13 -0
- package/dist/shared/utils/global/circularDistance.d.ts +3 -0
- package/dist/shared/utils/global/circularDistance.js +12 -0
- package/dist/shared/utils/global/fallbackIfMatch.cjs +13 -0
- package/dist/shared/utils/global/fallbackIfMatch.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfMatch.js +12 -0
- package/dist/shared/utils/global/fallbackIfNull.cjs +7 -0
- package/dist/shared/utils/global/fallbackIfNull.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfNull.js +6 -0
- package/dist/shared/utils/global/fallbackIfNullish.cjs +9 -0
- package/dist/shared/utils/global/fallbackIfNullish.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfNullish.js +8 -0
- package/dist/shared/utils/global/fallbackIfUndefined.cjs +7 -0
- package/dist/shared/utils/global/fallbackIfUndefined.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfUndefined.js +6 -0
- package/dist/shared/utils/global/firstNonNullish.cjs +40 -0
- package/dist/shared/utils/global/firstNonNullish.d.ts +3 -0
- package/dist/shared/utils/global/firstNonNullish.js +39 -0
- package/dist/shared/utils/global/flat.cjs +102 -0
- package/dist/shared/utils/global/flat.d.ts +16 -0
- package/dist/shared/utils/global/flat.js +100 -0
- package/dist/shared/utils/global/index.cjs +136 -0
- package/dist/shared/utils/global/index.d.ts +16 -0
- package/dist/shared/utils/global/index.js +15 -0
- package/dist/shared/utils/global/processFirstNonNullish.cjs +40 -0
- package/dist/shared/utils/global/processFirstNonNullish.d.ts +3 -0
- package/dist/shared/utils/global/processFirstNonNullish.js +38 -0
- package/dist/shared/utils/global/pureEnum.cjs +69 -0
- package/dist/shared/utils/global/pureEnum.d.ts +18 -0
- package/dist/shared/utils/global/pureEnum.js +66 -0
- package/dist/shared/utils/global/sleep.cjs +8 -0
- package/dist/shared/utils/global/sleep.d.ts +3 -0
- package/dist/shared/utils/global/sleep.js +7 -0
- package/dist/shared/utils/index.cjs +190 -0
- package/dist/shared/utils/index.d.ts +44 -0
- package/dist/shared/utils/index.js +21 -0
- package/dist/shared/utils/try-catch/TryCatch.cjs +237 -0
- package/dist/shared/utils/try-catch/TryCatch.d.ts +26 -0
- package/dist/shared/utils/try-catch/TryCatch.js +237 -0
- package/dist/shared/utils/try-catch/index.cjs +10 -0
- package/dist/shared/utils/try-catch/index.d.ts +1 -0
- package/dist/shared/utils/try-catch/index.js +1 -0
- package/package.json +6 -7
- package/dist/index.browser.d.cts +0 -484
- package/dist/index.d.cts +0 -6
- package/dist/index.node.d.cts +0 -168
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
|
+
try {
|
|
11
|
+
var info = gen[key](arg);
|
|
12
|
+
var value = info.value;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
reject(error);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (info.done) {
|
|
18
|
+
resolve(value);
|
|
19
|
+
} else {
|
|
20
|
+
Promise.resolve(value).then(_next, _throw);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _async_to_generator(fn) {
|
|
24
|
+
return function() {
|
|
25
|
+
var self = this, args = arguments;
|
|
26
|
+
return new Promise(function(resolve, reject) {
|
|
27
|
+
var gen = fn.apply(self, args);
|
|
28
|
+
function _next(value) {
|
|
29
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
30
|
+
}
|
|
31
|
+
function _throw(err) {
|
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
33
|
+
}
|
|
34
|
+
_next(undefined);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function _class_call_check(instance, Constructor) {
|
|
39
|
+
if (!(instance instanceof Constructor)) {
|
|
40
|
+
throw new TypeError("Cannot call a class as a function");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function _defineProperties(target, props) {
|
|
44
|
+
for(var i = 0; i < props.length; i++){
|
|
45
|
+
var descriptor = props[i];
|
|
46
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
47
|
+
descriptor.configurable = true;
|
|
48
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
49
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
53
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
54
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
55
|
+
return Constructor;
|
|
56
|
+
}
|
|
57
|
+
function _iterable_to_array(iter) {
|
|
58
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
59
|
+
}
|
|
60
|
+
function _non_iterable_spread() {
|
|
61
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
62
|
+
}
|
|
63
|
+
function _to_consumable_array(arr) {
|
|
64
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
65
|
+
}
|
|
66
|
+
function _type_of(obj) {
|
|
67
|
+
"@swc/helpers - typeof";
|
|
68
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
69
|
+
}
|
|
70
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
71
|
+
if (!o) return;
|
|
72
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
73
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
74
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
75
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
76
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
77
|
+
}
|
|
78
|
+
function _ts_generator(thisArg, body) {
|
|
79
|
+
var f, y, t, _ = {
|
|
80
|
+
label: 0,
|
|
81
|
+
sent: function() {
|
|
82
|
+
if (t[0] & 1) throw t[1];
|
|
83
|
+
return t[1];
|
|
84
|
+
},
|
|
85
|
+
trys: [],
|
|
86
|
+
ops: []
|
|
87
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
88
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
89
|
+
return this;
|
|
90
|
+
}), g;
|
|
91
|
+
function verb(n) {
|
|
92
|
+
return function(v) {
|
|
93
|
+
return step([
|
|
94
|
+
n,
|
|
95
|
+
v
|
|
96
|
+
]);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function step(op) {
|
|
100
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
101
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
102
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
103
|
+
if (y = 0, t) op = [
|
|
104
|
+
op[0] & 2,
|
|
105
|
+
t.value
|
|
106
|
+
];
|
|
107
|
+
switch(op[0]){
|
|
108
|
+
case 0:
|
|
109
|
+
case 1:
|
|
110
|
+
t = op;
|
|
111
|
+
break;
|
|
112
|
+
case 4:
|
|
113
|
+
_.label++;
|
|
114
|
+
return {
|
|
115
|
+
value: op[1],
|
|
116
|
+
done: false
|
|
117
|
+
};
|
|
118
|
+
case 5:
|
|
119
|
+
_.label++;
|
|
120
|
+
y = op[1];
|
|
121
|
+
op = [
|
|
122
|
+
0
|
|
123
|
+
];
|
|
124
|
+
continue;
|
|
125
|
+
case 7:
|
|
126
|
+
op = _.ops.pop();
|
|
127
|
+
_.trys.pop();
|
|
128
|
+
continue;
|
|
129
|
+
default:
|
|
130
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
131
|
+
_ = 0;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
135
|
+
_.label = op[1];
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
139
|
+
_.label = t[1];
|
|
140
|
+
t = op;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
if (t && _.label < t[2]) {
|
|
144
|
+
_.label = t[2];
|
|
145
|
+
_.ops.push(op);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
if (t[2]) _.ops.pop();
|
|
149
|
+
_.trys.pop();
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
op = body.call(thisArg, _);
|
|
153
|
+
} catch (e) {
|
|
154
|
+
op = [
|
|
155
|
+
6,
|
|
156
|
+
e
|
|
157
|
+
];
|
|
158
|
+
y = 0;
|
|
159
|
+
} finally{
|
|
160
|
+
f = t = 0;
|
|
161
|
+
}
|
|
162
|
+
if (op[0] & 5) throw op[1];
|
|
163
|
+
return {
|
|
164
|
+
value: op[0] ? op[1] : void 0,
|
|
165
|
+
done: true
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function _ts_values(o) {
|
|
170
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
171
|
+
if (m) return m.call(o);
|
|
172
|
+
if (o && typeof o.length === "number") return {
|
|
173
|
+
next: function() {
|
|
174
|
+
if (o && i >= o.length) o = void 0;
|
|
175
|
+
return {
|
|
176
|
+
value: o && o[i++],
|
|
177
|
+
done: !o
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
182
|
+
}
|
|
183
|
+
import { __publicField } from '../../chunk-PKBMQBKP.js';
|
|
184
|
+
import moment from 'moment';
|
|
185
|
+
import EventEmitter3 from 'eventemitter3';
|
|
186
|
+
var SequencerStatus = /* @__PURE__ */ function(SequencerStatus2) {
|
|
187
|
+
SequencerStatus2[SequencerStatus2["IDLE"] = 0] = "IDLE";
|
|
188
|
+
SequencerStatus2[SequencerStatus2["RUNNING"] = 1] = "RUNNING";
|
|
189
|
+
SequencerStatus2[SequencerStatus2["ERROR"] = 2] = "ERROR";
|
|
190
|
+
SequencerStatus2[SequencerStatus2["DONE"] = 3] = "DONE";
|
|
191
|
+
return SequencerStatus2;
|
|
192
|
+
}(SequencerStatus || {});
|
|
193
|
+
var SequencerEvent = /* @__PURE__ */ function(SequencerEvent2) {
|
|
194
|
+
SequencerEvent2["START"] = "START";
|
|
195
|
+
SequencerEvent2["END"] = "END";
|
|
196
|
+
SequencerEvent2["SEQUENCE_START"] = "SEQUENCE_START";
|
|
197
|
+
SequencerEvent2["SEQUENCE_END"] = "SEQUENCE_END";
|
|
198
|
+
return SequencerEvent2;
|
|
199
|
+
}(SequencerEvent || {});
|
|
200
|
+
var Sequencer = /*#__PURE__*/ function() {
|
|
201
|
+
"use strict";
|
|
202
|
+
function Sequencer(option) {
|
|
203
|
+
var _this = this;
|
|
204
|
+
_class_call_check(this, Sequencer);
|
|
205
|
+
__publicField(this, "sequences", []);
|
|
206
|
+
__publicField(this, "status", 0 /* IDLE */ );
|
|
207
|
+
__publicField(this, "minimumExecutionTime", 0);
|
|
208
|
+
// Reset variables task is done
|
|
209
|
+
__publicField(this, "currentSequence", null);
|
|
210
|
+
__publicField(this, "startTimestamp", null);
|
|
211
|
+
__publicField(this, "endTimestamp", null);
|
|
212
|
+
// Emitter
|
|
213
|
+
__publicField(this, "eventEmitter", new EventEmitter3());
|
|
214
|
+
__publicField(this, "pushSequence", function(sequence) {
|
|
215
|
+
_this.sequences.push(sequence);
|
|
216
|
+
});
|
|
217
|
+
__publicField(this, "start", function() {
|
|
218
|
+
return _async_to_generator(function() {
|
|
219
|
+
var _this, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _this1, _loop, _iterator, _step, _ret, err;
|
|
220
|
+
return _ts_generator(this, function(_state) {
|
|
221
|
+
switch(_state.label){
|
|
222
|
+
case 0:
|
|
223
|
+
_this = this;
|
|
224
|
+
if (this.status === 1 /* RUNNING */ ) {
|
|
225
|
+
console.warn("Sequencer status is", this.status);
|
|
226
|
+
return [
|
|
227
|
+
2
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
this.status = 1 /* RUNNING */ ;
|
|
231
|
+
this.currentSequence = null;
|
|
232
|
+
this.startTimestamp = this.getCurrentTimeStamp;
|
|
233
|
+
this.endTimestamp = null;
|
|
234
|
+
console.log("Sequence started, started at ".concat(this.startTimestamp, ", MINIMUM_EXECUTION_TIME is ").concat(this.minimumExecutionTime));
|
|
235
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
236
|
+
_state.label = 1;
|
|
237
|
+
case 1:
|
|
238
|
+
_state.trys.push([
|
|
239
|
+
1,
|
|
240
|
+
6,
|
|
241
|
+
7,
|
|
242
|
+
8
|
|
243
|
+
]);
|
|
244
|
+
_loop = function() {
|
|
245
|
+
var sequence, sequenceStartTimeStamp, e;
|
|
246
|
+
return _ts_generator(this, function(_state) {
|
|
247
|
+
switch(_state.label){
|
|
248
|
+
case 0:
|
|
249
|
+
sequence = _step.value;
|
|
250
|
+
console.log("Currently total execution time", _this1.executionTime);
|
|
251
|
+
sequenceStartTimeStamp = _this1.getCurrentTimeStamp;
|
|
252
|
+
_this1.currentSequence = sequence;
|
|
253
|
+
_this1.eventEmitter.emit("SEQUENCE_START" /* SEQUENCE_START */ , sequence);
|
|
254
|
+
_state.label = 1;
|
|
255
|
+
case 1:
|
|
256
|
+
_state.trys.push([
|
|
257
|
+
1,
|
|
258
|
+
3,
|
|
259
|
+
,
|
|
260
|
+
4
|
|
261
|
+
]);
|
|
262
|
+
return [
|
|
263
|
+
4,
|
|
264
|
+
new Promise(function(resolve, reject) {
|
|
265
|
+
return _async_to_generator(function() {
|
|
266
|
+
var _sequence_task, sequenceEndTimeStamp, sequenceExecutionTime, delay, dotInterpreterBlocked, dotInterpreter, e;
|
|
267
|
+
return _ts_generator(this, function(_state) {
|
|
268
|
+
switch(_state.label){
|
|
269
|
+
case 0:
|
|
270
|
+
_state.trys.push([
|
|
271
|
+
0,
|
|
272
|
+
2,
|
|
273
|
+
,
|
|
274
|
+
3
|
|
275
|
+
]);
|
|
276
|
+
console.log("Sequence ".concat(sequence.key, " start"));
|
|
277
|
+
return [
|
|
278
|
+
4,
|
|
279
|
+
(_sequence_task = sequence.task) === null || _sequence_task === void 0 ? void 0 : _sequence_task.call(sequence)
|
|
280
|
+
];
|
|
281
|
+
case 1:
|
|
282
|
+
_state.sent();
|
|
283
|
+
sequenceEndTimeStamp = this.getCurrentTimeStamp;
|
|
284
|
+
sequenceExecutionTime = sequenceEndTimeStamp - sequenceStartTimeStamp;
|
|
285
|
+
console.log("✅ Sequence ".concat(sequence.key, " done at"), sequenceEndTimeStamp);
|
|
286
|
+
console.log("Sequence execution time", sequenceExecutionTime, "ms");
|
|
287
|
+
if (sequence.minimumExecutionTime) {
|
|
288
|
+
console.log("Sequence has minimumExecutionTime", sequence.minimumExecutionTime, "ms");
|
|
289
|
+
if (sequenceExecutionTime < sequence.minimumExecutionTime) {
|
|
290
|
+
delay = sequence.minimumExecutionTime - sequenceExecutionTime;
|
|
291
|
+
console.log("Sequence will delay", delay, "ms");
|
|
292
|
+
dotInterpreterBlocked = false;
|
|
293
|
+
dotInterpreter = setInterval(function() {
|
|
294
|
+
if (dotInterpreterBlocked) {
|
|
295
|
+
console.log("!");
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
console.log(".");
|
|
299
|
+
}, 100);
|
|
300
|
+
setTimeout(function() {
|
|
301
|
+
dotInterpreterBlocked = true;
|
|
302
|
+
clearInterval(dotInterpreter);
|
|
303
|
+
console.log("done");
|
|
304
|
+
resolve();
|
|
305
|
+
}, delay);
|
|
306
|
+
return [
|
|
307
|
+
2
|
|
308
|
+
];
|
|
309
|
+
}
|
|
310
|
+
console.log("Sequence execution time is greater than minimum execution time");
|
|
311
|
+
resolve();
|
|
312
|
+
return [
|
|
313
|
+
2
|
|
314
|
+
];
|
|
315
|
+
}
|
|
316
|
+
resolve();
|
|
317
|
+
return [
|
|
318
|
+
3,
|
|
319
|
+
3
|
|
320
|
+
];
|
|
321
|
+
case 2:
|
|
322
|
+
e = _state.sent();
|
|
323
|
+
reject(e);
|
|
324
|
+
return [
|
|
325
|
+
3,
|
|
326
|
+
3
|
|
327
|
+
];
|
|
328
|
+
case 3:
|
|
329
|
+
return [
|
|
330
|
+
2
|
|
331
|
+
];
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}).call(_this);
|
|
335
|
+
})
|
|
336
|
+
];
|
|
337
|
+
case 2:
|
|
338
|
+
_state.sent();
|
|
339
|
+
console.log("Out of Promise");
|
|
340
|
+
_this1.eventEmitter.emit("SEQUENCE_END" /* SEQUENCE_END */ , sequence);
|
|
341
|
+
return [
|
|
342
|
+
3,
|
|
343
|
+
4
|
|
344
|
+
];
|
|
345
|
+
case 3:
|
|
346
|
+
e = _state.sent();
|
|
347
|
+
if (sequence.required) {
|
|
348
|
+
console.error("\uD83D\uDEAB Sequence ".concat(sequence.key, " failed"), e);
|
|
349
|
+
_this1.status = 2 /* ERROR */ ;
|
|
350
|
+
_this1.currentSequence = null;
|
|
351
|
+
_this1.endTimestamp = _this1.currentSequence;
|
|
352
|
+
return [
|
|
353
|
+
2,
|
|
354
|
+
{
|
|
355
|
+
v: Promise.reject({
|
|
356
|
+
sequence: sequence,
|
|
357
|
+
reason: e
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
];
|
|
361
|
+
}
|
|
362
|
+
console.log("Sequence ".concat(sequence.key, " failed"), e);
|
|
363
|
+
_this1.eventEmitter.emit("SEQUENCE_END" /* SEQUENCE_END */ , sequence);
|
|
364
|
+
return [
|
|
365
|
+
3,
|
|
366
|
+
4
|
|
367
|
+
];
|
|
368
|
+
case 4:
|
|
369
|
+
return [
|
|
370
|
+
2
|
|
371
|
+
];
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
_iterator = this.sequences[Symbol.iterator]();
|
|
376
|
+
_state.label = 2;
|
|
377
|
+
case 2:
|
|
378
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
379
|
+
3,
|
|
380
|
+
5
|
|
381
|
+
];
|
|
382
|
+
_this1 = this;
|
|
383
|
+
return [
|
|
384
|
+
5,
|
|
385
|
+
_ts_values(_loop())
|
|
386
|
+
];
|
|
387
|
+
case 3:
|
|
388
|
+
_ret = _state.sent();
|
|
389
|
+
if (_type_of(_ret) === "object") return [
|
|
390
|
+
2,
|
|
391
|
+
_ret.v
|
|
392
|
+
];
|
|
393
|
+
_state.label = 4;
|
|
394
|
+
case 4:
|
|
395
|
+
_iteratorNormalCompletion = true;
|
|
396
|
+
return [
|
|
397
|
+
3,
|
|
398
|
+
2
|
|
399
|
+
];
|
|
400
|
+
case 5:
|
|
401
|
+
return [
|
|
402
|
+
3,
|
|
403
|
+
8
|
|
404
|
+
];
|
|
405
|
+
case 6:
|
|
406
|
+
err = _state.sent();
|
|
407
|
+
_didIteratorError = true;
|
|
408
|
+
_iteratorError = err;
|
|
409
|
+
return [
|
|
410
|
+
3,
|
|
411
|
+
8
|
|
412
|
+
];
|
|
413
|
+
case 7:
|
|
414
|
+
try {
|
|
415
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
416
|
+
_iterator.return();
|
|
417
|
+
}
|
|
418
|
+
} finally{
|
|
419
|
+
if (_didIteratorError) {
|
|
420
|
+
throw _iteratorError;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return [
|
|
424
|
+
7
|
|
425
|
+
];
|
|
426
|
+
case 8:
|
|
427
|
+
this.status = 3 /* DONE */ ;
|
|
428
|
+
this.currentSequence = null;
|
|
429
|
+
this.endTimestamp = this.currentSequence;
|
|
430
|
+
return [
|
|
431
|
+
2
|
|
432
|
+
];
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}).call(_this);
|
|
436
|
+
});
|
|
437
|
+
if (option === null || option === void 0 ? void 0 : option.sequences) {
|
|
438
|
+
var _this_sequences;
|
|
439
|
+
(_this_sequences = this.sequences).push.apply(_this_sequences, _to_consumable_array(option.sequences));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
_create_class(Sequencer, [
|
|
443
|
+
{
|
|
444
|
+
key: "getCurrentTimeStamp",
|
|
445
|
+
get: function get() {
|
|
446
|
+
return parseInt(moment().format("x"), 10);
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
key: "executionTime",
|
|
451
|
+
get: function get() {
|
|
452
|
+
if (this.status === 0 /* IDLE */ ) {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
if (!this.startTimestamp) {
|
|
456
|
+
return null;
|
|
457
|
+
}
|
|
458
|
+
if (this.startTimestamp && this.endTimestamp) {
|
|
459
|
+
return this.endTimestamp - this.startTimestamp;
|
|
460
|
+
}
|
|
461
|
+
return this.getCurrentTimeStamp - this.startTimestamp;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
]);
|
|
465
|
+
return Sequencer;
|
|
466
|
+
}();
|
|
467
|
+
export { Sequencer, SequencerEvent, SequencerStatus };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
function _class_call_check(instance, Constructor) {
|
|
3
|
+
if (!(instance instanceof Constructor)) {
|
|
4
|
+
throw new TypeError("Cannot call a class as a function");
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function _defineProperties(target, props) {
|
|
8
|
+
for(var i = 0; i < props.length; i++){
|
|
9
|
+
var descriptor = props[i];
|
|
10
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
11
|
+
descriptor.configurable = true;
|
|
12
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
13
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
17
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
18
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
19
|
+
return Constructor;
|
|
20
|
+
}
|
|
21
|
+
var chunkETV4XYOV_cjs = require('../../chunk-ETV4XYOV.cjs');
|
|
22
|
+
var StringUtils = /*#__PURE__*/ function() {
|
|
23
|
+
function StringUtils() {
|
|
24
|
+
_class_call_check(this, StringUtils);
|
|
25
|
+
}
|
|
26
|
+
_create_class(StringUtils, null, [
|
|
27
|
+
{
|
|
28
|
+
key: "numberWithCommas",
|
|
29
|
+
value: function numberWithCommas(x) {
|
|
30
|
+
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "getByte",
|
|
35
|
+
value: function getByte(s) {
|
|
36
|
+
var getByteLength = function(decimal) {
|
|
37
|
+
var LINE_FEED = 10;
|
|
38
|
+
return decimal >> 7 || LINE_FEED === decimal ? 2 : 1;
|
|
39
|
+
};
|
|
40
|
+
return s.split("").map(function(s2) {
|
|
41
|
+
return s2.charCodeAt(0);
|
|
42
|
+
}).reduce(function(prev, unicodeDecimalValue) {
|
|
43
|
+
return prev + getByteLength(unicodeDecimalValue);
|
|
44
|
+
}, 0);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]);
|
|
48
|
+
return StringUtils;
|
|
49
|
+
}();
|
|
50
|
+
chunkETV4XYOV_cjs.__publicField(StringUtils, "levenshteinDistance", function() {
|
|
51
|
+
var str1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", str2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
52
|
+
var track = Array(str2.length + 1).fill(null).map(function() {
|
|
53
|
+
return Array(str1.length + 1).fill(null);
|
|
54
|
+
});
|
|
55
|
+
for(var i = 0; i <= str1.length; i += 1){
|
|
56
|
+
track[0][i] = i;
|
|
57
|
+
}
|
|
58
|
+
for(var j = 0; j <= str2.length; j += 1){
|
|
59
|
+
track[j][0] = j;
|
|
60
|
+
}
|
|
61
|
+
for(var j1 = 1; j1 <= str2.length; j1 += 1){
|
|
62
|
+
for(var i1 = 1; i1 <= str1.length; i1 += 1){
|
|
63
|
+
var indicator = str1[i1 - 1] === str2[j1 - 1] ? 0 : 1;
|
|
64
|
+
track[j1][i1] = Math.min(track[j1][i1 - 1] + 1, // deletion
|
|
65
|
+
track[j1 - 1][i1] + 1, // insertion
|
|
66
|
+
track[j1 - 1][i1 - 1] + indicator);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return track[str2.length][str1.length];
|
|
70
|
+
});
|
|
71
|
+
exports.StringUtils = StringUtils;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
|
+
if (!(instance instanceof Constructor)) {
|
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
import { __publicField } from '../../chunk-PKBMQBKP.js';
|
|
21
|
+
var StringUtils = /*#__PURE__*/ function() {
|
|
22
|
+
"use strict";
|
|
23
|
+
function StringUtils() {
|
|
24
|
+
_class_call_check(this, StringUtils);
|
|
25
|
+
}
|
|
26
|
+
_create_class(StringUtils, null, [
|
|
27
|
+
{
|
|
28
|
+
key: "numberWithCommas",
|
|
29
|
+
value: function numberWithCommas(x) {
|
|
30
|
+
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "getByte",
|
|
35
|
+
value: function getByte(s) {
|
|
36
|
+
var getByteLength = function(decimal) {
|
|
37
|
+
var LINE_FEED = 10;
|
|
38
|
+
return decimal >> 7 || LINE_FEED === decimal ? 2 : 1;
|
|
39
|
+
};
|
|
40
|
+
return s.split("").map(function(s2) {
|
|
41
|
+
return s2.charCodeAt(0);
|
|
42
|
+
}).reduce(function(prev, unicodeDecimalValue) {
|
|
43
|
+
return prev + getByteLength(unicodeDecimalValue);
|
|
44
|
+
}, 0);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]);
|
|
48
|
+
return StringUtils;
|
|
49
|
+
}();
|
|
50
|
+
__publicField(StringUtils, "levenshteinDistance", function() {
|
|
51
|
+
var str1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", str2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
52
|
+
var track = Array(str2.length + 1).fill(null).map(function() {
|
|
53
|
+
return Array(str1.length + 1).fill(null);
|
|
54
|
+
});
|
|
55
|
+
for(var i = 0; i <= str1.length; i += 1){
|
|
56
|
+
track[0][i] = i;
|
|
57
|
+
}
|
|
58
|
+
for(var j = 0; j <= str2.length; j += 1){
|
|
59
|
+
track[j][0] = j;
|
|
60
|
+
}
|
|
61
|
+
for(var j1 = 1; j1 <= str2.length; j1 += 1){
|
|
62
|
+
for(var i1 = 1; i1 <= str1.length; i1 += 1){
|
|
63
|
+
var indicator = str1[i1 - 1] === str2[j1 - 1] ? 0 : 1;
|
|
64
|
+
track[j1][i1] = Math.min(track[j1][i1 - 1] + 1, // deletion
|
|
65
|
+
track[j1 - 1][i1] + 1, // insertion
|
|
66
|
+
track[j1 - 1][i1 - 1] + indicator);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return track[str2.length][str1.length];
|
|
70
|
+
});
|
|
71
|
+
export { StringUtils };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
function _class_call_check(instance, Constructor) {
|
|
3
|
+
if (!(instance instanceof Constructor)) {
|
|
4
|
+
throw new TypeError("Cannot call a class as a function");
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function _defineProperties(target, props) {
|
|
8
|
+
for(var i = 0; i < props.length; i++){
|
|
9
|
+
var descriptor = props[i];
|
|
10
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
11
|
+
descriptor.configurable = true;
|
|
12
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
13
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
17
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
18
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
19
|
+
return Constructor;
|
|
20
|
+
}
|
|
21
|
+
require('../../chunk-ETV4XYOV.cjs');
|
|
22
|
+
var Uint8ArrayUtils = /*#__PURE__*/ function() {
|
|
23
|
+
function Uint8ArrayUtils() {
|
|
24
|
+
_class_call_check(this, Uint8ArrayUtils);
|
|
25
|
+
}
|
|
26
|
+
_create_class(Uint8ArrayUtils, null, [
|
|
27
|
+
{
|
|
28
|
+
key: "fromHex",
|
|
29
|
+
value: function fromHex(hex) {
|
|
30
|
+
var _hex_match;
|
|
31
|
+
var _hex_match_map;
|
|
32
|
+
return Uint8Array.from((_hex_match_map = (_hex_match = hex.match(/.{1,2}/g)) === null || _hex_match === void 0 ? void 0 : _hex_match.map(function(byte) {
|
|
33
|
+
return parseInt(byte, 16);
|
|
34
|
+
})) !== null && _hex_match_map !== void 0 ? _hex_match_map : []);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "toHex",
|
|
39
|
+
value: function toHex(bytes) {
|
|
40
|
+
return bytes.reduce(function(str, byte) {
|
|
41
|
+
return str + byte.toString(16).padStart(2, "0");
|
|
42
|
+
}, "");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]);
|
|
46
|
+
return Uint8ArrayUtils;
|
|
47
|
+
}();
|
|
48
|
+
exports.Uint8ArrayUtils = Uint8ArrayUtils;
|