@powfix/core-js 0.15.0-beta-1 → 0.15.0-beta-2
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/client/constants/COORDINATE.js +1 -5
- package/dist/client/constants/CRUD.js +3 -6
- package/dist/client/constants/DATE.js +2 -6
- package/dist/client/constants/DISTANCE.js +2 -6
- package/dist/client/constants/DURATION.js +2 -6
- package/dist/client/constants/NOT_NULL.js +1 -4
- package/dist/client/constants/index.browser.js +6 -22
- package/dist/client/index.browser.js +7 -23
- package/dist/client/interfaces/Coordinate.js +1 -2
- package/dist/client/interfaces/Point2.js +1 -2
- package/dist/client/interfaces/Point3.js +1 -2
- package/dist/client/interfaces/StorageProvider.js +1 -2
- package/dist/client/interfaces/index.browser.js +4 -20
- package/dist/client/managers/SessionManager.js +8 -15
- package/dist/client/managers/SessionManager.type.js +1 -2
- package/dist/client/managers/index.browser.js +2 -18
- package/dist/client/scripts/base64Polyfill.js +4 -8
- package/dist/client/scripts/index.browser.js +1 -17
- package/dist/client/services/index.browser.js +1 -17
- package/dist/client/services/time/TimeService.js +2 -9
- package/dist/client/services/time/TimeService.type.js +1 -2
- package/dist/client/services/time/index.js +2 -18
- package/dist/client/types/IntRage.js +1 -2
- package/dist/client/types/PartialExcept.js +1 -2
- package/dist/client/types/index.browser.js +2 -18
- package/dist/client/utils/ArrayUtils.js +3 -7
- package/dist/client/utils/AxiosUtils.js +1 -5
- package/dist/client/utils/BooleanUtils.js +1 -4
- package/dist/client/utils/Calc.js +1 -5
- package/dist/client/utils/CoordinateUtils.js +1 -5
- package/dist/client/utils/DateUtils.js +23 -30
- package/dist/client/utils/JuminNumberUtils.js +3 -7
- package/dist/client/utils/NumberUtils.js +1 -5
- package/dist/client/utils/ObjectIdUtils.js +4 -8
- package/dist/client/utils/Point3Utils.js +1 -5
- package/dist/client/utils/RandomUtils.js +1 -5
- package/dist/client/utils/Sequencer.js +9 -16
- package/dist/client/utils/StringUtils.js +1 -5
- package/dist/client/utils/UuidUtils.js +3 -10
- package/dist/client/utils/Validator.js +2 -6
- package/dist/client/utils/global/between.js +1 -5
- package/dist/client/utils/global/castArray.js +1 -4
- package/dist/client/utils/global/circularDistance.js +1 -4
- package/dist/client/utils/global/fallbackIfEqual.js +1 -4
- package/dist/client/utils/global/fallbackIfNull.js +3 -6
- package/dist/client/utils/global/fallbackIfUndefined.js +3 -6
- package/dist/client/utils/global/firstNonNullish.js +1 -4
- package/dist/client/utils/global/flat.js +2 -6
- package/dist/client/utils/global/index.js +11 -27
- package/dist/client/utils/global/processFirstNonNullish.js +3 -6
- package/dist/client/utils/global/pureEnum.js +3 -8
- package/dist/client/utils/global/sleep.js +1 -5
- package/dist/client/utils/index.browser.js +17 -33
- package/dist/client/utils/try-catch/TryCatch.js +1 -5
- package/dist/client/utils/try-catch/index.js +1 -17
- package/dist/server/utils/UuidUtils.js +35 -5
- package/package.json +1 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COORDINATE = void 0;
|
|
4
|
-
class COORDINATE {
|
|
1
|
+
export class COORDINATE {
|
|
5
2
|
}
|
|
6
|
-
exports.COORDINATE = COORDINATE;
|
|
7
3
|
COORDINATE.LATITUDE_MIN_LENGTH = 1;
|
|
8
4
|
COORDINATE.LATITUDE_MAX_LENGTH = 10;
|
|
9
5
|
COORDINATE.LONGITUDE_MIN_LENGTH = 1;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CRUD = void 0;
|
|
4
|
-
var CRUD;
|
|
1
|
+
export var CRUD;
|
|
5
2
|
(function (CRUD) {
|
|
6
3
|
CRUD[CRUD["CREATE"] = 1] = "CREATE";
|
|
7
4
|
CRUD[CRUD["READ"] = 2] = "READ";
|
|
8
5
|
CRUD[CRUD["UPDATE"] = 3] = "UPDATE";
|
|
9
6
|
CRUD[CRUD["DELETE"] = 4] = "DELETE";
|
|
10
|
-
})(CRUD || (
|
|
7
|
+
})(CRUD || (CRUD = {}));
|
|
11
8
|
(function (CRUD) {
|
|
12
9
|
function toString(crud) {
|
|
13
10
|
switch (crud) {
|
|
@@ -19,4 +16,4 @@ var CRUD;
|
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
CRUD.toString = toString;
|
|
22
|
-
})(CRUD || (
|
|
19
|
+
})(CRUD || (CRUD = {}));
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DATE = void 0;
|
|
4
|
-
class DATE {
|
|
1
|
+
export class DATE {
|
|
5
2
|
}
|
|
6
|
-
exports.DATE = DATE;
|
|
7
3
|
(function (DATE) {
|
|
8
4
|
let FORMAT;
|
|
9
5
|
(function (FORMAT) {
|
|
@@ -23,4 +19,4 @@ exports.DATE = DATE;
|
|
|
23
19
|
}
|
|
24
20
|
FORMAT.toString = toString;
|
|
25
21
|
})(FORMAT = DATE.FORMAT || (DATE.FORMAT = {}));
|
|
26
|
-
})(DATE || (
|
|
22
|
+
})(DATE || (DATE = {}));
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DISTANCE = void 0;
|
|
4
|
-
class DISTANCE {
|
|
1
|
+
export class DISTANCE {
|
|
5
2
|
}
|
|
6
|
-
exports.DISTANCE = DISTANCE;
|
|
7
3
|
(function (DISTANCE) {
|
|
8
4
|
let UNIT;
|
|
9
5
|
(function (UNIT) {
|
|
@@ -15,4 +11,4 @@ exports.DISTANCE = DISTANCE;
|
|
|
15
11
|
UNIT["MILES"] = "MILES";
|
|
16
12
|
UNIT["YARDS"] = "YARDS";
|
|
17
13
|
})(UNIT = DISTANCE.UNIT || (DISTANCE.UNIT = {}));
|
|
18
|
-
})(DISTANCE || (
|
|
14
|
+
})(DISTANCE || (DISTANCE = {}));
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DURATION = void 0;
|
|
4
|
-
class DURATION {
|
|
1
|
+
export class DURATION {
|
|
5
2
|
}
|
|
6
|
-
exports.DURATION = DURATION;
|
|
7
3
|
(function (DURATION) {
|
|
8
4
|
let UNIT;
|
|
9
5
|
(function (UNIT) {
|
|
@@ -18,4 +14,4 @@ exports.DURATION = DURATION;
|
|
|
18
14
|
UNIT["DECADES"] = "DECADES";
|
|
19
15
|
UNIT["CENTURIES"] = "CENTURIES";
|
|
20
16
|
})(UNIT = DURATION.UNIT || (DURATION.UNIT = {}));
|
|
21
|
-
})(DURATION || (
|
|
17
|
+
})(DURATION || (DURATION = {}));
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./COORDINATE.js"), exports);
|
|
18
|
-
__exportStar(require("./CRUD.js"), exports);
|
|
19
|
-
__exportStar(require("./DATE.js"), exports);
|
|
20
|
-
__exportStar(require("./DISTANCE.js"), exports);
|
|
21
|
-
__exportStar(require("./DURATION.js"), exports);
|
|
22
|
-
__exportStar(require("./NOT_NULL.js"), exports);
|
|
1
|
+
export * from './COORDINATE.js';
|
|
2
|
+
export * from './CRUD.js';
|
|
3
|
+
export * from './DATE.js';
|
|
4
|
+
export * from './DISTANCE.js';
|
|
5
|
+
export * from './DURATION.js';
|
|
6
|
+
export * from './NOT_NULL.js';
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./constants/index.browser.js"), exports);
|
|
18
|
-
__exportStar(require("./interfaces/index.browser.js"), exports);
|
|
19
|
-
__exportStar(require("./managers/index.browser.js"), exports);
|
|
20
|
-
__exportStar(require("./scripts/index.browser.js"), exports);
|
|
21
|
-
__exportStar(require("./services/index.browser.js"), exports);
|
|
22
|
-
__exportStar(require("./types/index.browser.js"), exports);
|
|
23
|
-
__exportStar(require("./utils/index.browser.js"), exports);
|
|
1
|
+
export * from './constants/index.browser.js';
|
|
2
|
+
export * from './interfaces/index.browser.js';
|
|
3
|
+
export * from './managers/index.browser.js';
|
|
4
|
+
export * from './scripts/index.browser.js';
|
|
5
|
+
export * from './services/index.browser.js';
|
|
6
|
+
export * from './types/index.browser.js';
|
|
7
|
+
export * from './utils/index.browser.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Coordinate.js"), exports);
|
|
18
|
-
__exportStar(require("./Point2.js"), exports);
|
|
19
|
-
__exportStar(require("./Point3.js"), exports);
|
|
20
|
-
__exportStar(require("./StorageProvider.js"), exports);
|
|
1
|
+
export * from './Coordinate.js';
|
|
2
|
+
export * from './Point2.js';
|
|
3
|
+
export * from './Point3.js';
|
|
4
|
+
export * from './StorageProvider.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,15 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.SessionManager = void 0;
|
|
16
|
-
const jwt_decode_1 = require("jwt-decode");
|
|
17
|
-
const moment_1 = __importDefault(require("moment"));
|
|
18
|
-
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
|
19
|
-
class SessionManager extends eventemitter3_1.default {
|
|
10
|
+
import { jwtDecode } from "jwt-decode";
|
|
11
|
+
import moment from "moment";
|
|
12
|
+
import EventEmitter from 'eventemitter3';
|
|
13
|
+
export class SessionManager extends EventEmitter {
|
|
20
14
|
constructor(options) {
|
|
21
15
|
super();
|
|
22
16
|
// Init service parameters
|
|
@@ -65,7 +59,7 @@ class SessionManager extends eventemitter3_1.default {
|
|
|
65
59
|
try {
|
|
66
60
|
// Replace Bearer prefix
|
|
67
61
|
nextAuthorization = nextAuthorization.replace(/^Bearer\s+/, '');
|
|
68
|
-
const decoded =
|
|
62
|
+
const decoded = jwtDecode(nextAuthorization);
|
|
69
63
|
if (!decoded) {
|
|
70
64
|
console.warn('JWT decode failed');
|
|
71
65
|
return null;
|
|
@@ -77,7 +71,7 @@ class SessionManager extends eventemitter3_1.default {
|
|
|
77
71
|
if (!decoded.iat) {
|
|
78
72
|
return [decoded.iat];
|
|
79
73
|
}
|
|
80
|
-
const iat =
|
|
74
|
+
const iat = moment.unix(decoded.iat);
|
|
81
75
|
if (!iat.isValid()) {
|
|
82
76
|
return [decoded.iat];
|
|
83
77
|
}
|
|
@@ -87,7 +81,7 @@ class SessionManager extends eventemitter3_1.default {
|
|
|
87
81
|
if (!decoded.nbf) {
|
|
88
82
|
return [decoded.nbf];
|
|
89
83
|
}
|
|
90
|
-
const nbf =
|
|
84
|
+
const nbf = moment.unix(decoded.nbf);
|
|
91
85
|
if (!nbf.isValid()) {
|
|
92
86
|
return [decoded.nbf];
|
|
93
87
|
}
|
|
@@ -97,7 +91,7 @@ class SessionManager extends eventemitter3_1.default {
|
|
|
97
91
|
if (!decoded.exp) {
|
|
98
92
|
return [decoded.exp];
|
|
99
93
|
}
|
|
100
|
-
const exp =
|
|
94
|
+
const exp = moment.unix(decoded.exp);
|
|
101
95
|
if (!exp.isValid()) {
|
|
102
96
|
return [decoded.exp];
|
|
103
97
|
}
|
|
@@ -130,5 +124,4 @@ class SessionManager extends eventemitter3_1.default {
|
|
|
130
124
|
});
|
|
131
125
|
}
|
|
132
126
|
}
|
|
133
|
-
exports.SessionManager = SessionManager;
|
|
134
127
|
SessionManager.DEFAULT_AUTHORIZATION_STORAGE_KEY = 'AUTHORIZATION';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./SessionManager.js"), exports);
|
|
18
|
-
__exportStar(require("./SessionManager.type.js"), exports);
|
|
1
|
+
export * from './SessionManager.js';
|
|
2
|
+
export * from './SessionManager.type.js';
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.base64Polyfill = void 0;
|
|
4
|
-
const base_64_1 = require("base-64");
|
|
5
|
-
const base64Polyfill = () => {
|
|
1
|
+
import { decode, encode } from 'base-64';
|
|
2
|
+
export const base64Polyfill = () => {
|
|
6
3
|
if (!global.btoa) {
|
|
7
|
-
global.btoa =
|
|
4
|
+
global.btoa = encode;
|
|
8
5
|
}
|
|
9
6
|
if (!global.atob) {
|
|
10
|
-
global.atob =
|
|
7
|
+
global.atob = decode;
|
|
11
8
|
}
|
|
12
9
|
console.log('base64-polyfill initialized', Date.now());
|
|
13
10
|
};
|
|
14
|
-
exports.base64Polyfill = base64Polyfill;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./base64Polyfill.js"), exports);
|
|
1
|
+
export * from './base64Polyfill.js';
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./time/index.js"), exports);
|
|
1
|
+
export * from './time/index.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,14 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TimeService = void 0;
|
|
16
|
-
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
|
10
|
+
import EventEmitter from 'eventemitter3';
|
|
17
11
|
const LOG_TAG = 'TimeService';
|
|
18
|
-
class TimeService extends
|
|
12
|
+
export class TimeService extends EventEmitter {
|
|
19
13
|
static calculateNTPResultOffset(ntpResult) {
|
|
20
14
|
const { t1, t2, t3, t4 } = ntpResult;
|
|
21
15
|
return ((t2 - t1) + (t3 - t4)) / 2;
|
|
@@ -177,4 +171,3 @@ class TimeService extends eventemitter3_1.default {
|
|
|
177
171
|
}
|
|
178
172
|
;
|
|
179
173
|
}
|
|
180
|
-
exports.TimeService = TimeService;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./TimeService.js"), exports);
|
|
18
|
-
__exportStar(require("./TimeService.type.js"), exports);
|
|
1
|
+
export * from "./TimeService.js";
|
|
2
|
+
export * from "./TimeService.type.js";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./IntRage.js"), exports);
|
|
18
|
-
__exportStar(require("./PartialExcept.js"), exports);
|
|
1
|
+
export * from './IntRage.js';
|
|
2
|
+
export * from './PartialExcept.js';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ArrayUtils = void 0;
|
|
4
|
-
const index_js_1 = require("./global/index.js");
|
|
5
|
-
class ArrayUtils {
|
|
1
|
+
import { castArray } from "./global/index.js";
|
|
2
|
+
export class ArrayUtils {
|
|
6
3
|
static castArray(value) {
|
|
7
|
-
return
|
|
4
|
+
return castArray(value);
|
|
8
5
|
}
|
|
9
6
|
/**
|
|
10
7
|
* 객체를 요소로 가지는 배열에서 가장 큰 값(Property)를 가지는 객체를 반환한다
|
|
@@ -27,4 +24,3 @@ class ArrayUtils {
|
|
|
27
24
|
return values.every((value) => value === values[0]);
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
|
-
exports.ArrayUtils = ArrayUtils;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AxiosUtils = void 0;
|
|
4
|
-
class AxiosUtils {
|
|
1
|
+
export class AxiosUtils {
|
|
5
2
|
static headerValue2String(value) {
|
|
6
3
|
if (value === undefined) {
|
|
7
4
|
return null;
|
|
@@ -50,4 +47,3 @@ class AxiosUtils {
|
|
|
50
47
|
return isNaN(result) ? null : result;
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
|
-
exports.AxiosUtils = AxiosUtils;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseBoolean = parseBoolean;
|
|
4
|
-
function parseBoolean(value, defaultValue) {
|
|
1
|
+
export function parseBoolean(value, defaultValue) {
|
|
5
2
|
if (value === undefined || value === null)
|
|
6
3
|
return defaultValue;
|
|
7
4
|
return (value === 'true' || value === true) || (value === 1 || value === '1');
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Calc = void 0;
|
|
4
|
-
class Calc {
|
|
1
|
+
export class Calc {
|
|
5
2
|
static average(...values) {
|
|
6
3
|
const length = values.length;
|
|
7
4
|
if (length === 0) {
|
|
@@ -24,4 +21,3 @@ class Calc {
|
|
|
24
21
|
: sorted[mid];
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
exports.Calc = Calc;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoordinateUtils = void 0;
|
|
4
|
-
class CoordinateUtils {
|
|
1
|
+
export class CoordinateUtils {
|
|
5
2
|
static isValidLatitude(latitude) {
|
|
6
3
|
return /^-?([0-8]?[0-9]|90)(\.[0-9]{1,15})$/.test(latitude.toString());
|
|
7
4
|
}
|
|
@@ -39,4 +36,3 @@ class CoordinateUtils {
|
|
|
39
36
|
return totalDistance;
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
exports.CoordinateUtils = CoordinateUtils;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DateUtils = void 0;
|
|
7
|
-
const moment_1 = __importDefault(require("moment"));
|
|
8
|
-
const DATE_js_1 = require("../constants/DATE.js");
|
|
9
|
-
class DateUtils {
|
|
1
|
+
import moment from "moment";
|
|
2
|
+
import { DATE } from "../constants/DATE.js";
|
|
3
|
+
export class DateUtils {
|
|
10
4
|
static isPositiveInteger(value, strict) {
|
|
11
5
|
if (strict) {
|
|
12
6
|
if (typeof value !== 'number') {
|
|
@@ -55,12 +49,12 @@ class DateUtils {
|
|
|
55
49
|
}
|
|
56
50
|
else {
|
|
57
51
|
switch (format) {
|
|
58
|
-
case
|
|
59
|
-
case
|
|
60
|
-
case
|
|
61
|
-
case
|
|
52
|
+
case DATE.FORMAT.UNIX: return DateUtils.isUnix(value, strict);
|
|
53
|
+
case DATE.FORMAT.SECONDS: return DateUtils.isSeconds(value, strict);
|
|
54
|
+
case DATE.FORMAT.MILLISECONDS: return DateUtils.isMilliseconds(value, strict);
|
|
55
|
+
case DATE.FORMAT.ISO_8601: return DateUtils.isISO8601(value);
|
|
62
56
|
default: {
|
|
63
|
-
throw new Error(`unknown format: ${format}(${(_a =
|
|
57
|
+
throw new Error(`unknown format: ${format}(${(_a = DATE.FORMAT.toString(format)) !== null && _a !== void 0 ? _a : 'unknown'})`);
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
}
|
|
@@ -75,40 +69,39 @@ class DateUtils {
|
|
|
75
69
|
}
|
|
76
70
|
if (format === undefined) {
|
|
77
71
|
if (DateUtils.isMilliseconds(value, strict)) {
|
|
78
|
-
return DateUtils.from(value,
|
|
72
|
+
return DateUtils.from(value, DATE.FORMAT.MILLISECONDS);
|
|
79
73
|
}
|
|
80
74
|
if (DateUtils.isISO8601(value)) {
|
|
81
|
-
return DateUtils.from(value,
|
|
75
|
+
return DateUtils.from(value, DATE.FORMAT.ISO_8601);
|
|
82
76
|
}
|
|
83
77
|
throw new Error(`no option to convert value to date`);
|
|
84
78
|
}
|
|
85
79
|
switch (format) {
|
|
86
|
-
case
|
|
87
|
-
case
|
|
88
|
-
case
|
|
89
|
-
case
|
|
80
|
+
case DATE.FORMAT.UNIX: return new Date(Number(value) * 1000);
|
|
81
|
+
case DATE.FORMAT.SECONDS: return new Date(Number(value) * 1000);
|
|
82
|
+
case DATE.FORMAT.MILLISECONDS: return new Date(Number(value));
|
|
83
|
+
case DATE.FORMAT.ISO_8601: return new Date(value);
|
|
90
84
|
default: {
|
|
91
|
-
throw new Error(`unknown format: ${format}(${(_a =
|
|
85
|
+
throw new Error(`unknown format: ${format}(${(_a = DATE.FORMAT.toString(format)) !== null && _a !== void 0 ? _a : 'unknown'})`);
|
|
92
86
|
}
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
89
|
static fromUnix(value, strict) {
|
|
96
|
-
return DateUtils.from(value,
|
|
90
|
+
return DateUtils.from(value, DATE.FORMAT.UNIX, strict);
|
|
97
91
|
}
|
|
98
92
|
static fromSeconds(value, strict) {
|
|
99
|
-
return DateUtils.from(value,
|
|
93
|
+
return DateUtils.from(value, DATE.FORMAT.SECONDS, strict);
|
|
100
94
|
}
|
|
101
95
|
static fromMilliseconds(value, strict) {
|
|
102
|
-
return DateUtils.from(value,
|
|
96
|
+
return DateUtils.from(value, DATE.FORMAT.MILLISECONDS, strict);
|
|
103
97
|
}
|
|
104
98
|
static fromISO8601(value) {
|
|
105
|
-
return DateUtils.from(value,
|
|
99
|
+
return DateUtils.from(value, DATE.FORMAT.ISO_8601);
|
|
106
100
|
}
|
|
107
101
|
}
|
|
108
|
-
exports.DateUtils = DateUtils;
|
|
109
102
|
DateUtils.relativeDate = (input, base = Date.now()) => {
|
|
110
103
|
// Create new moment instance to apply new locale
|
|
111
|
-
const datetime =
|
|
104
|
+
const datetime = moment.isMoment(input) ? moment(input.toDate()) : moment(input);
|
|
112
105
|
if (!datetime.isValid()) {
|
|
113
106
|
console.error('core-js:DateUtils.relativeDate() datetime is invalid', datetime);
|
|
114
107
|
return '<INVALID DATE>';
|
|
@@ -118,9 +111,9 @@ DateUtils.relativeDate = (input, base = Date.now()) => {
|
|
|
118
111
|
DateUtils.setLocale = (language) => {
|
|
119
112
|
const relativeTime = DateUtils.getRelativeTimeSpec(language);
|
|
120
113
|
if (relativeTime !== undefined) {
|
|
121
|
-
|
|
114
|
+
moment.updateLocale(language, { relativeTime });
|
|
122
115
|
}
|
|
123
|
-
|
|
116
|
+
moment.locale(language);
|
|
124
117
|
};
|
|
125
118
|
DateUtils.getRelativeTimeSpec = (locale) => {
|
|
126
119
|
if (locale in DateUtils.relativeTimeSpecs) {
|
|
@@ -307,4 +300,4 @@ DateUtils.getRelativeTimeSpec = (locale) => {
|
|
|
307
300
|
yy: number => `${number} taon`
|
|
308
301
|
},
|
|
309
302
|
};
|
|
310
|
-
})(DateUtils || (
|
|
303
|
+
})(DateUtils || (DateUtils = {}));
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.JuminNumberUtils = void 0;
|
|
4
|
-
const between_js_1 = require("./global/between.js");
|
|
5
|
-
class JuminNumberUtils {
|
|
1
|
+
import { between } from "./global/between.js";
|
|
2
|
+
export class JuminNumberUtils {
|
|
6
3
|
static calculateX(juminNumber) {
|
|
7
4
|
const replacedJuminNumber = juminNumber.replace(/\D/g, '');
|
|
8
|
-
if (!
|
|
5
|
+
if (!between(replacedJuminNumber.length, 12, 13)) {
|
|
9
6
|
throw new Error('Jumin number length must be 12 to 13(without dash)');
|
|
10
7
|
}
|
|
11
8
|
const numbers = replacedJuminNumber.split('').map(e => parseInt(e, 10));
|
|
@@ -47,4 +44,3 @@ class JuminNumberUtils {
|
|
|
47
44
|
return true;
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
|
-
exports.JuminNumberUtils = JuminNumberUtils;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberUtils = void 0;
|
|
4
|
-
class NumberUtils {
|
|
1
|
+
export class NumberUtils {
|
|
5
2
|
static formatWithThousandsSeparator(value, separator = ',') {
|
|
6
3
|
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
7
4
|
}
|
|
@@ -22,4 +19,3 @@ class NumberUtils {
|
|
|
22
19
|
return value.toString();
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.NumberUtils = NumberUtils;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ObjectIdUtils = void 0;
|
|
4
|
-
const UuidUtils_js_1 = require("./UuidUtils.js");
|
|
5
|
-
class ObjectIdUtils {
|
|
1
|
+
import { UuidUtils } from "./UuidUtils.js";
|
|
2
|
+
export class ObjectIdUtils {
|
|
6
3
|
static toUuid(objectId, pad = 'start') {
|
|
7
4
|
const result = Buffer.alloc(16);
|
|
8
5
|
Buffer.from(objectId, 'hex').copy(result, pad === 'start' ? 4 : 0);
|
|
9
|
-
return
|
|
6
|
+
return UuidUtils.toString(result);
|
|
10
7
|
}
|
|
11
8
|
static fromUuid(uuid, pad) {
|
|
12
|
-
const buffer =
|
|
9
|
+
const buffer = UuidUtils.toBuffer(uuid);
|
|
13
10
|
const isPadEnd = buffer.subarray(buffer.length - 4).every(byte => byte === 0);
|
|
14
11
|
if (isPadEnd || pad === 'end') {
|
|
15
12
|
return buffer.subarray(0, buffer.length - 4).toString('hex');
|
|
@@ -21,4 +18,3 @@ class ObjectIdUtils {
|
|
|
21
18
|
return buffer.subarray(4).toString('hex');
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
exports.ObjectIdUtils = ObjectIdUtils;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Point3Utils = void 0;
|
|
4
|
-
class Point3Utils {
|
|
1
|
+
export class Point3Utils {
|
|
5
2
|
static distance(p1, p2) {
|
|
6
3
|
const dx = p1.x - p2.x;
|
|
7
4
|
const dy = p1.y - p2.y;
|
|
@@ -9,4 +6,3 @@ class Point3Utils {
|
|
|
9
6
|
return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.Point3Utils = Point3Utils;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RandomUtils = void 0;
|
|
4
|
-
class RandomUtils {
|
|
1
|
+
export class RandomUtils {
|
|
5
2
|
static randomNumber(min, max) {
|
|
6
3
|
min = Math.ceil(min);
|
|
7
4
|
max = Math.floor(max);
|
|
@@ -61,4 +58,3 @@ class RandomUtils {
|
|
|
61
58
|
return strings.join('');
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
|
-
exports.RandomUtils = RandomUtils;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,28 +7,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Sequencer = exports.SequencerEvent = exports.SequencerStatus = void 0;
|
|
16
|
-
const moment_js_1 = __importDefault(require("moment/moment.js"));
|
|
17
|
-
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
|
18
|
-
var SequencerStatus;
|
|
10
|
+
import moment from "moment/moment.js";
|
|
11
|
+
import EventEmitter3 from 'eventemitter3';
|
|
12
|
+
export var SequencerStatus;
|
|
19
13
|
(function (SequencerStatus) {
|
|
20
14
|
SequencerStatus[SequencerStatus["IDLE"] = 0] = "IDLE";
|
|
21
15
|
SequencerStatus[SequencerStatus["RUNNING"] = 1] = "RUNNING";
|
|
22
16
|
SequencerStatus[SequencerStatus["ERROR"] = 2] = "ERROR";
|
|
23
17
|
SequencerStatus[SequencerStatus["DONE"] = 3] = "DONE";
|
|
24
|
-
})(SequencerStatus || (
|
|
25
|
-
var SequencerEvent;
|
|
18
|
+
})(SequencerStatus || (SequencerStatus = {}));
|
|
19
|
+
export var SequencerEvent;
|
|
26
20
|
(function (SequencerEvent) {
|
|
27
21
|
SequencerEvent["START"] = "START";
|
|
28
22
|
SequencerEvent["END"] = "END";
|
|
29
23
|
SequencerEvent["SEQUENCE_START"] = "SEQUENCE_START";
|
|
30
24
|
SequencerEvent["SEQUENCE_END"] = "SEQUENCE_END";
|
|
31
|
-
})(SequencerEvent || (
|
|
32
|
-
class Sequencer {
|
|
25
|
+
})(SequencerEvent || (SequencerEvent = {}));
|
|
26
|
+
export class Sequencer {
|
|
33
27
|
constructor(option) {
|
|
34
28
|
this.sequences = [];
|
|
35
29
|
this.status = SequencerStatus.IDLE;
|
|
@@ -39,7 +33,7 @@ class Sequencer {
|
|
|
39
33
|
this.startTimestamp = null;
|
|
40
34
|
this.endTimestamp = null;
|
|
41
35
|
// Emitter
|
|
42
|
-
this.eventEmitter = new
|
|
36
|
+
this.eventEmitter = new EventEmitter3();
|
|
43
37
|
this.pushSequence = (sequence) => {
|
|
44
38
|
this.sequences.push(sequence);
|
|
45
39
|
};
|
|
@@ -130,7 +124,7 @@ class Sequencer {
|
|
|
130
124
|
}
|
|
131
125
|
}
|
|
132
126
|
get getCurrentTimeStamp() {
|
|
133
|
-
return parseInt((
|
|
127
|
+
return parseInt(moment().format('x'), 10);
|
|
134
128
|
}
|
|
135
129
|
get executionTime() {
|
|
136
130
|
if (this.status === SequencerStatus.IDLE) {
|
|
@@ -145,4 +139,3 @@ class Sequencer {
|
|
|
145
139
|
return this.getCurrentTimeStamp - this.startTimestamp;
|
|
146
140
|
}
|
|
147
141
|
}
|
|
148
|
-
exports.Sequencer = Sequencer;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StringUtils = void 0;
|
|
4
|
-
class StringUtils {
|
|
1
|
+
export class StringUtils {
|
|
5
2
|
static numberWithCommas(x) {
|
|
6
3
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
7
4
|
}
|
|
@@ -16,7 +13,6 @@ class StringUtils {
|
|
|
16
13
|
.reduce((prev, unicodeDecimalValue) => prev + getByteLength(unicodeDecimalValue), 0);
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.StringUtils = StringUtils;
|
|
20
16
|
StringUtils.levenshteinDistance = (str1 = '', str2 = '') => {
|
|
21
17
|
const track = Array(str2.length + 1).fill(null).map(() => Array(str1.length + 1).fill(null));
|
|
22
18
|
for (let i = 0; i <= str1.length; i += 1) {
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UuidUtils = void 0;
|
|
7
|
-
const uuid_1 = __importDefault(require("uuid"));
|
|
1
|
+
import * as uuid from "uuid";
|
|
8
2
|
function binaryToString(binary) {
|
|
9
3
|
return Buffer.from(binary).toString('hex');
|
|
10
4
|
}
|
|
11
|
-
class UuidUtils {
|
|
5
|
+
export class UuidUtils {
|
|
12
6
|
static v4() {
|
|
13
|
-
return
|
|
7
|
+
return uuid.v4();
|
|
14
8
|
}
|
|
15
9
|
static format(uuid) {
|
|
16
10
|
if (uuid.length === 32) {
|
|
@@ -46,4 +40,3 @@ class UuidUtils {
|
|
|
46
40
|
return RegExp(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/i).test(uuid);
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
|
-
exports.UuidUtils = UuidUtils;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Validator = void 0;
|
|
4
|
-
class Validator {
|
|
1
|
+
export class Validator {
|
|
5
2
|
static validate(value, options) {
|
|
6
3
|
value = value || '';
|
|
7
4
|
const validations = [];
|
|
@@ -93,7 +90,6 @@ class Validator {
|
|
|
93
90
|
};
|
|
94
91
|
}
|
|
95
92
|
}
|
|
96
|
-
exports.Validator = Validator;
|
|
97
93
|
(function (Validator) {
|
|
98
94
|
let VALIDATION;
|
|
99
95
|
(function (VALIDATION) {
|
|
@@ -115,4 +111,4 @@ exports.Validator = Validator;
|
|
|
115
111
|
VALIDATION["STARTS_WITH_NUMBER"] = "STARTS_WITH_NUMBER";
|
|
116
112
|
VALIDATION["STARTS_WITH_SPECIAL_CHARACTER"] = "STARTS_WITH_SPECIAL_CHARACTER";
|
|
117
113
|
})(VALIDATION = Validator.VALIDATION || (Validator.VALIDATION = {}));
|
|
118
|
-
})(Validator || (
|
|
114
|
+
})(Validator || (Validator = {}));
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.between = void 0;
|
|
4
|
-
const between = (value, from, to) => {
|
|
1
|
+
export const between = (value, from, to) => {
|
|
5
2
|
return value >= from && value <= to;
|
|
6
3
|
};
|
|
7
|
-
exports.between = between;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.circularDistance = circularDistance;
|
|
4
|
-
function circularDistance(value, target, min, max) {
|
|
1
|
+
export function circularDistance(value, target, min, max) {
|
|
5
2
|
const range = max - min;
|
|
6
3
|
const from = value - min;
|
|
7
4
|
const to = target - min;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fallbackIfEqual = fallbackIfEqual;
|
|
4
|
-
function fallbackIfEqual(value, condition, fallback) {
|
|
1
|
+
export function fallbackIfEqual(value, condition, fallback) {
|
|
5
2
|
if (typeof value === typeof condition && value === condition) {
|
|
6
3
|
return fallback;
|
|
7
4
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const fallbackIfEqual_js_1 = require("./fallbackIfEqual.js");
|
|
5
|
-
function fallbackIfNull(value, fallback) {
|
|
6
|
-
return (0, fallbackIfEqual_js_1.fallbackIfEqual)(value, null, fallback);
|
|
1
|
+
import { fallbackIfEqual } from "./fallbackIfEqual.js";
|
|
2
|
+
export function fallbackIfNull(value, fallback) {
|
|
3
|
+
return fallbackIfEqual(value, null, fallback);
|
|
7
4
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const fallbackIfEqual_js_1 = require("./fallbackIfEqual.js");
|
|
5
|
-
function fallbackIfUndefined(value, fallback) {
|
|
6
|
-
return (0, fallbackIfEqual_js_1.fallbackIfEqual)(value, undefined, fallback);
|
|
1
|
+
import { fallbackIfEqual } from "./fallbackIfEqual.js";
|
|
2
|
+
export function fallbackIfUndefined(value, fallback) {
|
|
3
|
+
return fallbackIfEqual(value, undefined, fallback);
|
|
7
4
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.firstNonNullish = firstNonNullish;
|
|
4
|
-
function firstNonNullish(...args) {
|
|
1
|
+
export function firstNonNullish(...args) {
|
|
5
2
|
if (args == null || !Array.isArray(args) || args.length === 0) {
|
|
6
3
|
return undefined;
|
|
7
4
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// flat.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.flatten = flatten;
|
|
5
|
-
exports.unflatten = unflatten;
|
|
6
2
|
function isBuffer(obj) {
|
|
7
3
|
return !!(obj &&
|
|
8
4
|
obj.constructor &&
|
|
@@ -12,7 +8,7 @@ function isBuffer(obj) {
|
|
|
12
8
|
function keyIdentity(key) {
|
|
13
9
|
return key;
|
|
14
10
|
}
|
|
15
|
-
function flatten(target, opts = {}) {
|
|
11
|
+
export function flatten(target, opts = {}) {
|
|
16
12
|
const delimiter = opts.delimiter || '.';
|
|
17
13
|
const maxDepth = opts.maxDepth;
|
|
18
14
|
const transformKey = opts.transformKey || keyIdentity;
|
|
@@ -40,7 +36,7 @@ function flatten(target, opts = {}) {
|
|
|
40
36
|
step(target);
|
|
41
37
|
return output;
|
|
42
38
|
}
|
|
43
|
-
function unflatten(target, opts = {}) {
|
|
39
|
+
export function unflatten(target, opts = {}) {
|
|
44
40
|
const delimiter = opts.delimiter || '.';
|
|
45
41
|
const overwrite = opts.overwrite || false;
|
|
46
42
|
const transformKey = opts.transformKey || keyIdentity;
|
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./between.js"), exports);
|
|
18
|
-
__exportStar(require("./castArray.js"), exports);
|
|
19
|
-
__exportStar(require("./circularDistance.js"), exports);
|
|
20
|
-
__exportStar(require("./sleep.js"), exports);
|
|
21
|
-
__exportStar(require("./fallbackIfEqual.js"), exports);
|
|
22
|
-
__exportStar(require("./fallbackIfNull.js"), exports);
|
|
23
|
-
__exportStar(require("./fallbackIfUndefined.js"), exports);
|
|
24
|
-
__exportStar(require("./firstNonNullish.js"), exports);
|
|
25
|
-
__exportStar(require("./flat.js"), exports);
|
|
26
|
-
__exportStar(require("./processFirstNonNullish.js"), exports);
|
|
27
|
-
__exportStar(require("./pureEnum.js"), exports);
|
|
1
|
+
export * from './between.js';
|
|
2
|
+
export * from './castArray.js';
|
|
3
|
+
export * from './circularDistance.js';
|
|
4
|
+
export * from './sleep.js';
|
|
5
|
+
export * from './fallbackIfEqual.js';
|
|
6
|
+
export * from './fallbackIfNull.js';
|
|
7
|
+
export * from './fallbackIfUndefined.js';
|
|
8
|
+
export * from './firstNonNullish.js';
|
|
9
|
+
export * from './flat.js';
|
|
10
|
+
export * from './processFirstNonNullish.js';
|
|
11
|
+
export * from './pureEnum.js';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const firstNonNullish_js_1 = require("./firstNonNullish.js");
|
|
5
|
-
function processFirstNonNullish(processor, ...args) {
|
|
6
|
-
const fallback = (0, firstNonNullish_js_1.firstNonNullish)(...args);
|
|
1
|
+
import { firstNonNullish } from "./firstNonNullish.js";
|
|
2
|
+
export function processFirstNonNullish(processor, ...args) {
|
|
3
|
+
const fallback = firstNonNullish(...args);
|
|
7
4
|
if (fallback == null) {
|
|
8
5
|
return undefined;
|
|
9
6
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pureEnum = pureEnum;
|
|
4
|
-
exports.pureEnumKeys = pureEnumKeys;
|
|
5
|
-
exports.pureEnumValues = pureEnumValues;
|
|
6
|
-
function pureEnum(e) {
|
|
1
|
+
export function pureEnum(e) {
|
|
7
2
|
return Object.entries(e).filter(([key, value]) => !/^-?\d+$/g.test(key) && typeof value !== 'function');
|
|
8
3
|
}
|
|
9
|
-
function pureEnumKeys(e) {
|
|
4
|
+
export function pureEnumKeys(e) {
|
|
10
5
|
return pureEnum(e).map(([key]) => key);
|
|
11
6
|
}
|
|
12
|
-
function pureEnumValues(e) {
|
|
7
|
+
export function pureEnumValues(e) {
|
|
13
8
|
return pureEnum(e).map(([, value]) => value);
|
|
14
9
|
}
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sleep = void 0;
|
|
4
|
-
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
5
|
-
exports.sleep = sleep;
|
|
1
|
+
export const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
@@ -1,33 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./ArrayUtils.js"), exports);
|
|
19
|
-
__exportStar(require("./AxiosUtils.js"), exports);
|
|
20
|
-
__exportStar(require("./StringUtils.js"), exports);
|
|
21
|
-
__exportStar(require("./UuidUtils.js"), exports);
|
|
22
|
-
__exportStar(require("./BooleanUtils.js"), exports);
|
|
23
|
-
__exportStar(require("./Calc.js"), exports);
|
|
24
|
-
__exportStar(require("./CoordinateUtils.js"), exports);
|
|
25
|
-
__exportStar(require("./DateUtils.js"), exports);
|
|
26
|
-
__exportStar(require("./NumberUtils.js"), exports);
|
|
27
|
-
__exportStar(require("./ObjectIdUtils.js"), exports);
|
|
28
|
-
__exportStar(require("./Point3Utils.js"), exports);
|
|
29
|
-
__exportStar(require("./RandomUtils.js"), exports);
|
|
30
|
-
__exportStar(require("./Validator.js"), exports);
|
|
31
|
-
__exportStar(require("./JuminNumberUtils.js"), exports);
|
|
32
|
-
__exportStar(require("./Sequencer.js"), exports);
|
|
33
|
-
__exportStar(require("./try-catch/index.js"), exports);
|
|
1
|
+
export * from './global/index.js';
|
|
2
|
+
export * from './ArrayUtils.js';
|
|
3
|
+
export * from './AxiosUtils.js';
|
|
4
|
+
export * from './StringUtils.js';
|
|
5
|
+
export * from './UuidUtils.js';
|
|
6
|
+
export * from './BooleanUtils.js';
|
|
7
|
+
export * from './Calc.js';
|
|
8
|
+
export * from './CoordinateUtils.js';
|
|
9
|
+
export * from './DateUtils.js';
|
|
10
|
+
export * from './NumberUtils.js';
|
|
11
|
+
export * from './ObjectIdUtils.js';
|
|
12
|
+
export * from './Point3Utils.js';
|
|
13
|
+
export * from './RandomUtils.js';
|
|
14
|
+
export * from './Validator.js';
|
|
15
|
+
export * from './JuminNumberUtils.js';
|
|
16
|
+
export * from './Sequencer.js';
|
|
17
|
+
export * from './try-catch/index.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,13 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TryCatch = void 0;
|
|
13
10
|
/**
|
|
14
11
|
* Provides a utility class for handling synchronous and asynchronous operations with a consistent try-catch pattern.
|
|
15
12
|
* It returns a tuple where the first element is the error (or null on success) and the second element is the result (or undefined on error).
|
|
16
13
|
*/
|
|
17
|
-
class TryCatch {
|
|
14
|
+
export class TryCatch {
|
|
18
15
|
/**
|
|
19
16
|
* Executes a synchronous function within a try-catch block.
|
|
20
17
|
* @template T The return type of the function.
|
|
@@ -75,4 +72,3 @@ class TryCatch {
|
|
|
75
72
|
});
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
|
-
exports.TryCatch = TryCatch;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./TryCatch.js"), exports);
|
|
1
|
+
export * from "./TryCatch.js";
|
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.UuidUtils = void 0;
|
|
7
|
-
const
|
|
37
|
+
const uuid = __importStar(require("uuid"));
|
|
8
38
|
function binaryToString(binary) {
|
|
9
39
|
return Buffer.from(binary).toString('hex');
|
|
10
40
|
}
|
|
11
41
|
class UuidUtils {
|
|
12
42
|
static v4() {
|
|
13
|
-
return
|
|
43
|
+
return uuid.v4();
|
|
14
44
|
}
|
|
15
45
|
static format(uuid) {
|
|
16
46
|
if (uuid.length === 32) {
|