@powfix/core-js 0.22.2 → 0.23.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/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/node/constants/TransactionManagerLogLevel.cjs +11 -0
- package/dist/node/constants/TransactionManagerLogLevel.d.ts +9 -0
- package/dist/node/constants/TransactionManagerLogLevel.js +10 -0
- package/dist/node/constants/TransactionManagerTimeoutAction.cjs +8 -0
- package/dist/node/constants/TransactionManagerTimeoutAction.d.ts +6 -0
- package/dist/node/constants/TransactionManagerTimeoutAction.js +7 -0
- package/dist/node/constants/index.cjs +19 -0
- package/dist/node/constants/index.d.ts +2 -0
- package/dist/node/constants/index.js +2 -0
- package/dist/node/index.cjs +55 -0
- package/dist/node/index.d.ts +25 -0
- package/dist/node/index.js +6 -0
- package/dist/node/interfaces/db/index.cjs +10 -0
- package/dist/node/interfaces/db/index.d.ts +10 -0
- package/dist/node/interfaces/db/index.js +1 -0
- package/dist/node/interfaces/db/sequelize/Hook.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/Hook.d.ts +13 -0
- package/dist/node/interfaces/db/sequelize/Hook.js +0 -0
- package/dist/node/interfaces/db/sequelize/HookFn.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/HookFn.d.ts +7 -0
- package/dist/node/interfaces/db/sequelize/HookFn.js +0 -0
- package/dist/node/interfaces/db/sequelize/HookType.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/HookType.d.ts +6 -0
- package/dist/node/interfaces/db/sequelize/HookType.js +0 -0
- package/dist/node/interfaces/db/sequelize/ReloadOption.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/ReloadOption.d.ts +5 -0
- package/dist/node/interfaces/db/sequelize/ReloadOption.js +0 -0
- package/dist/node/interfaces/db/sequelize/TransactionOption.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/TransactionOption.d.ts +7 -0
- package/dist/node/interfaces/db/sequelize/TransactionOption.js +0 -0
- package/dist/node/interfaces/db/sequelize/UpsertOptions.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/UpsertOptions.d.ts +8 -0
- package/dist/node/interfaces/db/sequelize/UpsertOptions.js +0 -0
- package/dist/node/interfaces/db/sequelize/index.cjs +55 -0
- package/dist/node/interfaces/db/sequelize/index.d.ts +10 -0
- package/dist/node/interfaces/db/sequelize/index.js +6 -0
- package/dist/node/interfaces/index.cjs +10 -0
- package/dist/node/interfaces/index.d.ts +10 -0
- package/dist/node/interfaces/index.js +1 -0
- package/dist/node/managers/TransactionManager.cjs +463 -0
- package/dist/node/managers/TransactionManager.d.ts +31 -0
- package/dist/node/managers/TransactionManager.js +457 -0
- package/dist/node/managers/TransactionManager.types.cjs +1 -0
- package/dist/node/managers/TransactionManager.types.d.ts +12 -0
- package/dist/node/managers/TransactionManager.types.js +0 -0
- package/dist/node/managers/index.cjs +19 -0
- package/dist/node/managers/index.d.ts +6 -0
- package/dist/node/managers/index.js +2 -0
- package/dist/node/services/index.cjs +10 -0
- package/dist/node/services/index.d.ts +5 -0
- package/dist/node/services/index.js +1 -0
- package/dist/node/services/redis/RedisClient.cjs +250 -0
- package/dist/node/services/redis/RedisClient.d.ts +24 -0
- package/dist/node/services/redis/RedisClient.js +250 -0
- package/dist/node/services/redis/RedisPublisher.cjs +323 -0
- package/dist/node/services/redis/RedisPublisher.d.ts +17 -0
- package/dist/node/services/redis/RedisPublisher.js +323 -0
- package/dist/node/services/redis/RedisSubscriber.cjs +502 -0
- package/dist/node/services/redis/RedisSubscriber.d.ts +15 -0
- package/dist/node/services/redis/RedisSubscriber.js +502 -0
- package/dist/node/services/redis/index.cjs +28 -0
- package/dist/node/services/redis/index.d.ts +5 -0
- package/dist/node/services/redis/index.js +3 -0
- package/dist/node/types/UpsertResult.cjs +1 -0
- package/dist/node/types/UpsertResult.d.ts +5 -0
- package/dist/node/types/UpsertResult.js +0 -0
- package/dist/node/types/index.cjs +19 -0
- package/dist/node/types/index.d.ts +9 -0
- package/dist/node/types/index.js +2 -0
- package/dist/node/types/mariaDb.cjs +1 -0
- package/dist/node/types/mariaDb.d.ts +15 -0
- package/dist/node/types/mariaDb.js +0 -0
- package/dist/node/utils/HookUtils.cjs +87 -0
- package/dist/node/utils/HookUtils.d.ts +20 -0
- package/dist/node/utils/HookUtils.js +87 -0
- package/dist/node/utils/index.cjs +19 -0
- package/dist/node/utils/index.d.ts +10 -0
- package/dist/node/utils/index.js +2 -0
- package/dist/node/utils/sequelize-utils/SequelizeUtils.cjs +165 -0
- package/dist/node/utils/sequelize-utils/SequelizeUtils.d.ts +12 -0
- package/dist/node/utils/sequelize-utils/SequelizeUtils.js +165 -0
- package/dist/node/utils/sequelize-utils/index.cjs +19 -0
- package/dist/node/utils/sequelize-utils/index.d.ts +3 -0
- package/dist/node/utils/sequelize-utils/index.js +2 -0
- package/dist/node/utils/sequelize-utils/types.cjs +1 -0
- package/dist/node/utils/sequelize-utils/types.d.ts +19 -0
- package/dist/node/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,142 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _class_call_check(instance, Constructor) {
|
|
11
|
+
if (!(instance instanceof Constructor)) {
|
|
12
|
+
throw new TypeError("Cannot call a class as a function");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _defineProperties(target, props) {
|
|
16
|
+
for(var i = 0; i < props.length; i++){
|
|
17
|
+
var descriptor = props[i];
|
|
18
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
19
|
+
descriptor.configurable = true;
|
|
20
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
21
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
25
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
26
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
27
|
+
return Constructor;
|
|
28
|
+
}
|
|
29
|
+
function _iterable_to_array_limit(arr, i) {
|
|
30
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
31
|
+
if (_i == null) return;
|
|
32
|
+
var _arr = [];
|
|
33
|
+
var _n = true;
|
|
34
|
+
var _d = false;
|
|
35
|
+
var _s, _e;
|
|
36
|
+
try {
|
|
37
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
38
|
+
_arr.push(_s.value);
|
|
39
|
+
if (i && _arr.length === i) break;
|
|
40
|
+
}
|
|
41
|
+
} catch (err) {
|
|
42
|
+
_d = true;
|
|
43
|
+
_e = err;
|
|
44
|
+
} finally{
|
|
45
|
+
try {
|
|
46
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
47
|
+
} finally{
|
|
48
|
+
if (_d) throw _e;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return _arr;
|
|
52
|
+
}
|
|
53
|
+
function _non_iterable_rest() {
|
|
54
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
55
|
+
}
|
|
56
|
+
function _sliced_to_array(arr, i) {
|
|
57
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
58
|
+
}
|
|
59
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
60
|
+
if (!o) return;
|
|
61
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
62
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
63
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
64
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
65
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
66
|
+
}
|
|
67
|
+
var chunkETV4XYOV_cjs = require('../../chunk-ETV4XYOV.cjs');
|
|
68
|
+
var Enum = /*#__PURE__*/ function() {
|
|
69
|
+
function Enum(e) {
|
|
70
|
+
_class_call_check(this, Enum);
|
|
71
|
+
chunkETV4XYOV_cjs.__publicField(this, "_e");
|
|
72
|
+
chunkETV4XYOV_cjs.__publicField(this, "_entries");
|
|
73
|
+
chunkETV4XYOV_cjs.__publicField(this, "_keys");
|
|
74
|
+
chunkETV4XYOV_cjs.__publicField(this, "_values");
|
|
75
|
+
this._e = e;
|
|
76
|
+
this._entries = Enum.entries(e);
|
|
77
|
+
this._keys = Enum.keys(e);
|
|
78
|
+
this._values = Enum.values(e);
|
|
79
|
+
}
|
|
80
|
+
_create_class(Enum, [
|
|
81
|
+
{
|
|
82
|
+
key: "value",
|
|
83
|
+
value: function value() {
|
|
84
|
+
return this._e;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "entries",
|
|
89
|
+
value: function entries() {
|
|
90
|
+
return this._entries;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "keys",
|
|
95
|
+
value: function keys() {
|
|
96
|
+
return this._keys;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "values",
|
|
101
|
+
value: function values() {
|
|
102
|
+
return this._values;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
], [
|
|
106
|
+
{
|
|
107
|
+
key: "entries",
|
|
108
|
+
value: function entries(e) {
|
|
109
|
+
return Object.entries(e).filter(function(param) {
|
|
110
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
111
|
+
return !/^-?\d+$/g.test(key) && typeof value !== "function";
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "keys",
|
|
117
|
+
value: function keys(e) {
|
|
118
|
+
return Enum.entries(e).map(function(param) {
|
|
119
|
+
var _param = _sliced_to_array(param, 1), key = _param[0];
|
|
120
|
+
return key;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: "values",
|
|
126
|
+
value: function values(e) {
|
|
127
|
+
return Enum.entries(e).map(function(param) {
|
|
128
|
+
var _param = _sliced_to_array(param, 2), value = _param[1];
|
|
129
|
+
return value;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: "from",
|
|
135
|
+
value: function from(e) {
|
|
136
|
+
return new Enum(e);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]);
|
|
140
|
+
return Enum;
|
|
141
|
+
}();
|
|
142
|
+
exports.Enum = Enum;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EnumEntries } from './Enum.types.js';
|
|
2
|
+
|
|
3
|
+
declare class Enum<E extends object> {
|
|
4
|
+
static entries<E extends object>(e: E): EnumEntries<E>;
|
|
5
|
+
static keys<E extends object>(e: E): ({ [K in keyof E]: E[K] extends Function ? never : K; }[keyof E] extends infer R ? R extends never ? never : R : never)[];
|
|
6
|
+
static values<E extends object>(e: E): ({ [K in keyof E]: E[K] extends Function ? never : E[K]; }[keyof E] extends infer R ? R extends never ? never : R : never)[];
|
|
7
|
+
static from<E extends object>(e: E): Enum<E>;
|
|
8
|
+
private readonly _e;
|
|
9
|
+
private readonly _entries;
|
|
10
|
+
private readonly _keys;
|
|
11
|
+
private readonly _values;
|
|
12
|
+
constructor(e: E);
|
|
13
|
+
value(): E;
|
|
14
|
+
entries(): EnumEntries<E>;
|
|
15
|
+
keys(): ({ [K in keyof E]: E[K] extends Function ? never : K; }[keyof E] extends infer R ? R extends never ? never : R : never)[];
|
|
16
|
+
values(): ({ [K in keyof E]: E[K] extends Function ? never : E[K]; }[keyof E] extends infer R ? R extends never ? never : R : never)[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Enum };
|
|
@@ -0,0 +1,142 @@
|
|
|
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_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _class_call_check(instance, Constructor) {
|
|
10
|
+
if (!(instance instanceof Constructor)) {
|
|
11
|
+
throw new TypeError("Cannot call a class as a function");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function _defineProperties(target, props) {
|
|
15
|
+
for(var i = 0; i < props.length; i++){
|
|
16
|
+
var descriptor = props[i];
|
|
17
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
18
|
+
descriptor.configurable = true;
|
|
19
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
20
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
24
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
25
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26
|
+
return Constructor;
|
|
27
|
+
}
|
|
28
|
+
function _iterable_to_array_limit(arr, i) {
|
|
29
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
30
|
+
if (_i == null) return;
|
|
31
|
+
var _arr = [];
|
|
32
|
+
var _n = true;
|
|
33
|
+
var _d = false;
|
|
34
|
+
var _s, _e;
|
|
35
|
+
try {
|
|
36
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
37
|
+
_arr.push(_s.value);
|
|
38
|
+
if (i && _arr.length === i) break;
|
|
39
|
+
}
|
|
40
|
+
} catch (err) {
|
|
41
|
+
_d = true;
|
|
42
|
+
_e = err;
|
|
43
|
+
} finally{
|
|
44
|
+
try {
|
|
45
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
46
|
+
} finally{
|
|
47
|
+
if (_d) throw _e;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return _arr;
|
|
51
|
+
}
|
|
52
|
+
function _non_iterable_rest() {
|
|
53
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
54
|
+
}
|
|
55
|
+
function _sliced_to_array(arr, i) {
|
|
56
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
57
|
+
}
|
|
58
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
59
|
+
if (!o) return;
|
|
60
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
61
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
62
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
63
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
64
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
65
|
+
}
|
|
66
|
+
import { __publicField } from '../../chunk-PKBMQBKP.js';
|
|
67
|
+
var Enum = /*#__PURE__*/ function() {
|
|
68
|
+
"use strict";
|
|
69
|
+
function Enum(e) {
|
|
70
|
+
_class_call_check(this, Enum);
|
|
71
|
+
__publicField(this, "_e");
|
|
72
|
+
__publicField(this, "_entries");
|
|
73
|
+
__publicField(this, "_keys");
|
|
74
|
+
__publicField(this, "_values");
|
|
75
|
+
this._e = e;
|
|
76
|
+
this._entries = Enum.entries(e);
|
|
77
|
+
this._keys = Enum.keys(e);
|
|
78
|
+
this._values = Enum.values(e);
|
|
79
|
+
}
|
|
80
|
+
_create_class(Enum, [
|
|
81
|
+
{
|
|
82
|
+
key: "value",
|
|
83
|
+
value: function value() {
|
|
84
|
+
return this._e;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "entries",
|
|
89
|
+
value: function entries() {
|
|
90
|
+
return this._entries;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "keys",
|
|
95
|
+
value: function keys() {
|
|
96
|
+
return this._keys;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "values",
|
|
101
|
+
value: function values() {
|
|
102
|
+
return this._values;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
], [
|
|
106
|
+
{
|
|
107
|
+
key: "entries",
|
|
108
|
+
value: function entries(e) {
|
|
109
|
+
return Object.entries(e).filter(function(param) {
|
|
110
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
111
|
+
return !/^-?\d+$/g.test(key) && typeof value !== "function";
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "keys",
|
|
117
|
+
value: function keys(e) {
|
|
118
|
+
return Enum.entries(e).map(function(param) {
|
|
119
|
+
var _param = _sliced_to_array(param, 1), key = _param[0];
|
|
120
|
+
return key;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: "values",
|
|
126
|
+
value: function values(e) {
|
|
127
|
+
return Enum.entries(e).map(function(param) {
|
|
128
|
+
var _param = _sliced_to_array(param, 2), value = _param[1];
|
|
129
|
+
return value;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: "from",
|
|
135
|
+
value: function from(e) {
|
|
136
|
+
return new Enum(e);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]);
|
|
140
|
+
return Enum;
|
|
141
|
+
}();
|
|
142
|
+
export { Enum };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type NonFunction<T, Type extends "keys" | "values"> = {
|
|
2
|
+
[K in keyof T]: T[K] extends Function ? never : Type extends "keys" ? K : T[K];
|
|
3
|
+
}[keyof T] extends infer R ? (R extends never ? never : R) : never;
|
|
4
|
+
type EnumEntry<E extends object> = [NonFunction<E, "keys">, NonFunction<E, "values">];
|
|
5
|
+
type EnumEntries<E extends object> = EnumEntry<E>[];
|
|
6
|
+
|
|
7
|
+
export type { EnumEntries, EnumEntry };
|
|
File without changes
|
|
@@ -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 deepmerge = require('deepmerge');
|
|
23
|
+
function _interopDefault(e) {
|
|
24
|
+
return e && e.__esModule ? e : {
|
|
25
|
+
default: e
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var deepmerge__default = /*#__PURE__*/ _interopDefault(deepmerge);
|
|
29
|
+
var I18nUtils = /*#__PURE__*/ function() {
|
|
30
|
+
function I18nUtils() {
|
|
31
|
+
_class_call_check(this, I18nUtils);
|
|
32
|
+
}
|
|
33
|
+
_create_class(I18nUtils, null, [
|
|
34
|
+
{
|
|
35
|
+
key: "mergeResources",
|
|
36
|
+
value: function mergeResources() {
|
|
37
|
+
for(var _len = arguments.length, resources = new Array(_len), _key = 0; _key < _len; _key++){
|
|
38
|
+
resources[_key] = arguments[_key];
|
|
39
|
+
}
|
|
40
|
+
return resources.reduce(function(acc, resource) {
|
|
41
|
+
return deepmerge__default.default(acc, resource);
|
|
42
|
+
}, {});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]);
|
|
46
|
+
return I18nUtils;
|
|
47
|
+
}();
|
|
48
|
+
exports.I18nUtils = I18nUtils;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 '../../chunk-PKBMQBKP.js';
|
|
21
|
+
import deepmerge from 'deepmerge';
|
|
22
|
+
var I18nUtils = /*#__PURE__*/ function() {
|
|
23
|
+
"use strict";
|
|
24
|
+
function I18nUtils() {
|
|
25
|
+
_class_call_check(this, I18nUtils);
|
|
26
|
+
}
|
|
27
|
+
_create_class(I18nUtils, null, [
|
|
28
|
+
{
|
|
29
|
+
key: "mergeResources",
|
|
30
|
+
value: function mergeResources() {
|
|
31
|
+
for(var _len = arguments.length, resources = new Array(_len), _key = 0; _key < _len; _key++){
|
|
32
|
+
resources[_key] = arguments[_key];
|
|
33
|
+
}
|
|
34
|
+
return resources.reduce(function(acc, resource) {
|
|
35
|
+
return deepmerge(acc, resource);
|
|
36
|
+
}, {});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]);
|
|
40
|
+
return I18nUtils;
|
|
41
|
+
}();
|
|
42
|
+
export { I18nUtils };
|
|
@@ -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
|
+
require('../../chunk-ETV4XYOV.cjs');
|
|
22
|
+
var between = require('./global/between');
|
|
23
|
+
var JuminNumberUtils = /*#__PURE__*/ function() {
|
|
24
|
+
function JuminNumberUtils() {
|
|
25
|
+
_class_call_check(this, JuminNumberUtils);
|
|
26
|
+
}
|
|
27
|
+
_create_class(JuminNumberUtils, null, [
|
|
28
|
+
{
|
|
29
|
+
key: "calculateX",
|
|
30
|
+
value: function calculateX(juminNumber) {
|
|
31
|
+
var replacedJuminNumber = juminNumber.replace(/\D/g, "");
|
|
32
|
+
if (!between.between(replacedJuminNumber.length, 12, 13)) {
|
|
33
|
+
throw new Error("Jumin number length must be 12 to 13(without dash)");
|
|
34
|
+
}
|
|
35
|
+
var numbers = replacedJuminNumber.split("").map(function(e) {
|
|
36
|
+
return parseInt(e, 10);
|
|
37
|
+
});
|
|
38
|
+
var sum = 2 * numbers[0] + 3 * numbers[1] + 4 * numbers[2] + 5 * numbers[3] + 6 * numbers[4] + 7 * numbers[5] + 8 * numbers[6] + 9 * numbers[7] + 2 * numbers[8] + 3 * numbers[9] + 4 * numbers[10] + 5 * numbers[11];
|
|
39
|
+
return (11 - sum % 11) % 10;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "isValid",
|
|
44
|
+
value: function isValid(juminNumber) {
|
|
45
|
+
var replacedJuminNumber = juminNumber.replace(/\D/g, "");
|
|
46
|
+
if (replacedJuminNumber.length !== 13) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
var TODAY_YEAR = parseInt(/* @__PURE__ */ new Date().getFullYear().toString().slice(-2), 10);
|
|
50
|
+
var yearNum = parseInt(replacedJuminNumber.slice(0, 2), 10);
|
|
51
|
+
var sexNum = replacedJuminNumber.slice(6, 7);
|
|
52
|
+
if (sexNum === "1" || sexNum === "2") {
|
|
53
|
+
if (yearNum < TODAY_YEAR) return false;
|
|
54
|
+
} else if (sexNum === "3" || sexNum === "4") {
|
|
55
|
+
if (yearNum > TODAY_YEAR) return false;
|
|
56
|
+
} else return false;
|
|
57
|
+
var regex = /^\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{7}$/;
|
|
58
|
+
if (!regex.test(replacedJuminNumber)) return false;
|
|
59
|
+
var currentX = parseInt(replacedJuminNumber.slice(-1), 10);
|
|
60
|
+
var calculatedX = JuminNumberUtils.calculateX(replacedJuminNumber);
|
|
61
|
+
if (currentX !== calculatedX) {
|
|
62
|
+
console.log("Invalid X", currentX, calculatedX);
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
return JuminNumberUtils;
|
|
70
|
+
}();
|
|
71
|
+
exports.JuminNumberUtils = JuminNumberUtils;
|
|
@@ -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 '../../chunk-PKBMQBKP.js';
|
|
21
|
+
import { between } from './global/between';
|
|
22
|
+
var JuminNumberUtils = /*#__PURE__*/ function() {
|
|
23
|
+
"use strict";
|
|
24
|
+
function JuminNumberUtils() {
|
|
25
|
+
_class_call_check(this, JuminNumberUtils);
|
|
26
|
+
}
|
|
27
|
+
_create_class(JuminNumberUtils, null, [
|
|
28
|
+
{
|
|
29
|
+
key: "calculateX",
|
|
30
|
+
value: function calculateX(juminNumber) {
|
|
31
|
+
var replacedJuminNumber = juminNumber.replace(/\D/g, "");
|
|
32
|
+
if (!between(replacedJuminNumber.length, 12, 13)) {
|
|
33
|
+
throw new Error("Jumin number length must be 12 to 13(without dash)");
|
|
34
|
+
}
|
|
35
|
+
var numbers = replacedJuminNumber.split("").map(function(e) {
|
|
36
|
+
return parseInt(e, 10);
|
|
37
|
+
});
|
|
38
|
+
var sum = 2 * numbers[0] + 3 * numbers[1] + 4 * numbers[2] + 5 * numbers[3] + 6 * numbers[4] + 7 * numbers[5] + 8 * numbers[6] + 9 * numbers[7] + 2 * numbers[8] + 3 * numbers[9] + 4 * numbers[10] + 5 * numbers[11];
|
|
39
|
+
return (11 - sum % 11) % 10;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "isValid",
|
|
44
|
+
value: function isValid(juminNumber) {
|
|
45
|
+
var replacedJuminNumber = juminNumber.replace(/\D/g, "");
|
|
46
|
+
if (replacedJuminNumber.length !== 13) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
var TODAY_YEAR = parseInt(/* @__PURE__ */ new Date().getFullYear().toString().slice(-2), 10);
|
|
50
|
+
var yearNum = parseInt(replacedJuminNumber.slice(0, 2), 10);
|
|
51
|
+
var sexNum = replacedJuminNumber.slice(6, 7);
|
|
52
|
+
if (sexNum === "1" || sexNum === "2") {
|
|
53
|
+
if (yearNum < TODAY_YEAR) return false;
|
|
54
|
+
} else if (sexNum === "3" || sexNum === "4") {
|
|
55
|
+
if (yearNum > TODAY_YEAR) return false;
|
|
56
|
+
} else return false;
|
|
57
|
+
var regex = /^\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{7}$/;
|
|
58
|
+
if (!regex.test(replacedJuminNumber)) return false;
|
|
59
|
+
var currentX = parseInt(replacedJuminNumber.slice(-1), 10);
|
|
60
|
+
var calculatedX = JuminNumberUtils.calculateX(replacedJuminNumber);
|
|
61
|
+
if (currentX !== calculatedX) {
|
|
62
|
+
console.log("Invalid X", currentX, calculatedX);
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
return JuminNumberUtils;
|
|
70
|
+
}();
|
|
71
|
+
export { JuminNumberUtils };
|
|
@@ -0,0 +1,80 @@
|
|
|
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 NumberUtils = /*#__PURE__*/ function() {
|
|
23
|
+
function NumberUtils() {
|
|
24
|
+
_class_call_check(this, NumberUtils);
|
|
25
|
+
}
|
|
26
|
+
_create_class(NumberUtils, null, [
|
|
27
|
+
{
|
|
28
|
+
key: "formatWithThousandsSeparator",
|
|
29
|
+
value: function formatWithThousandsSeparator(value) {
|
|
30
|
+
var separator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ",";
|
|
31
|
+
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "formatBigNumber",
|
|
36
|
+
value: function formatBigNumber(value) {
|
|
37
|
+
var precision = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2;
|
|
38
|
+
var map = [
|
|
39
|
+
{
|
|
40
|
+
suffix: "Qi",
|
|
41
|
+
threshold: 1e18
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
suffix: "Q",
|
|
45
|
+
threshold: 1e15
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
suffix: "T",
|
|
49
|
+
threshold: 1e12
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
suffix: "B",
|
|
53
|
+
threshold: 1e9
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
suffix: "M",
|
|
57
|
+
threshold: 1e6
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
suffix: "K",
|
|
61
|
+
threshold: 1e3
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
suffix: "",
|
|
65
|
+
threshold: 1
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
var found = map.find(function(e) {
|
|
69
|
+
return Math.abs(value) >= e.threshold;
|
|
70
|
+
});
|
|
71
|
+
if (found) {
|
|
72
|
+
return Number((value / found.threshold).toFixed(precision)) + found.suffix;
|
|
73
|
+
}
|
|
74
|
+
return value.toString();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]);
|
|
78
|
+
return NumberUtils;
|
|
79
|
+
}();
|
|
80
|
+
exports.NumberUtils = NumberUtils;
|