@akanjs/common 0.0.40 → 0.0.41
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/index.d.ts +1 -19
- package/index.js +344 -21
- package/package.json +5 -2
- package/src/Logger.d.ts +2 -3
- package/src/applyMixins.d.ts +2 -3
- package/src/capitalize.d.ts +1 -3
- package/src/deepObjectify.d.ts +1 -3
- package/src/index.d.ts +18 -19
- package/src/isDayjs.d.ts +2 -2
- package/src/isQueryEqual.d.ts +1 -3
- package/src/isValidDate.d.ts +2 -5
- package/src/lowerlize.d.ts +1 -3
- package/src/mergeVersion.d.ts +1 -3
- package/src/objectify.d.ts +1 -3
- package/src/pathGet.d.ts +1 -3
- package/src/pathSet.d.ts +1 -3
- package/src/pluralize.d.ts +2 -1
- package/src/randomPick.d.ts +1 -3
- package/src/randomPicks.d.ts +1 -3
- package/src/sleep.d.ts +1 -3
- package/src/splitVersion.d.ts +1 -3
- package/src/types.d.ts +5 -8
- package/src/Logger.js +0 -162
- package/src/applyMixins.js +0 -49
- package/src/capitalize.js +0 -30
- package/src/deepObjectify.js +0 -48
- package/src/index.js +0 -75
- package/src/isDayjs.js +0 -27
- package/src/isQueryEqual.js +0 -58
- package/src/isValidDate.js +0 -48
- package/src/lowerlize.js +0 -30
- package/src/mergeVersion.js +0 -28
- package/src/objectify.js +0 -34
- package/src/pathGet.js +0 -31
- package/src/pathSet.js +0 -33
- package/src/pluralize.js +0 -37
- package/src/randomPick.js +0 -28
- package/src/randomPicks.js +0 -39
- package/src/sleep.js +0 -34
- package/src/splitVersion.js +0 -35
- package/src/types.js +0 -15
package/src/Logger.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var Logger_exports = {};
|
|
30
|
-
__export(Logger_exports, {
|
|
31
|
-
Logger: () => Logger
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(Logger_exports);
|
|
34
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
35
|
-
const logLevels = [
|
|
36
|
-
"trace",
|
|
37
|
-
"verbose",
|
|
38
|
-
"debug",
|
|
39
|
-
"log",
|
|
40
|
-
"info",
|
|
41
|
-
"warn",
|
|
42
|
-
"error"
|
|
43
|
-
];
|
|
44
|
-
const clc = {
|
|
45
|
-
bold: /* @__PURE__ */ __name((text) => `\x1B[1m${text}\x1B[0m`, "bold"),
|
|
46
|
-
green: /* @__PURE__ */ __name((text) => `\x1B[32m${text}\x1B[39m`, "green"),
|
|
47
|
-
yellow: /* @__PURE__ */ __name((text) => `\x1B[33m${text}\x1B[39m`, "yellow"),
|
|
48
|
-
red: /* @__PURE__ */ __name((text) => `\x1B[31m${text}\x1B[39m`, "red"),
|
|
49
|
-
magentaBright: /* @__PURE__ */ __name((text) => `\x1B[95m${text}\x1B[39m`, "magentaBright"),
|
|
50
|
-
cyanBright: /* @__PURE__ */ __name((text) => `\x1B[96m${text}\x1B[39m`, "cyanBright")
|
|
51
|
-
};
|
|
52
|
-
const colorizeMap = {
|
|
53
|
-
trace: clc.bold,
|
|
54
|
-
verbose: clc.cyanBright,
|
|
55
|
-
debug: clc.magentaBright,
|
|
56
|
-
log: clc.green,
|
|
57
|
-
info: clc.green,
|
|
58
|
-
warn: clc.yellow,
|
|
59
|
-
error: clc.red
|
|
60
|
-
};
|
|
61
|
-
class Logger {
|
|
62
|
-
static {
|
|
63
|
-
__name(this, "Logger");
|
|
64
|
-
}
|
|
65
|
-
static #ignoreCtxSet = /* @__PURE__ */ new Set([
|
|
66
|
-
"InstanceLoader",
|
|
67
|
-
"RoutesResolver",
|
|
68
|
-
"RouterExplorer",
|
|
69
|
-
"NestFactory",
|
|
70
|
-
"WebSocketsController",
|
|
71
|
-
"GraphQLModule",
|
|
72
|
-
"NestApplication"
|
|
73
|
-
]);
|
|
74
|
-
static level = process.env.NEXT_PUBLIC_LOG_LEVEL ?? "log";
|
|
75
|
-
static #levelIdx = logLevels.findIndex((l) => l === process.env.NEXT_PUBLIC_LOG_LEVEL);
|
|
76
|
-
static #startAt = (0, import_dayjs.default)();
|
|
77
|
-
static setLevel(level) {
|
|
78
|
-
this.level = level;
|
|
79
|
-
this.#levelIdx = logLevels.findIndex((l) => l === level);
|
|
80
|
-
}
|
|
81
|
-
name;
|
|
82
|
-
constructor(name) {
|
|
83
|
-
this.name = name;
|
|
84
|
-
}
|
|
85
|
-
trace(msg, context = "") {
|
|
86
|
-
if (Logger.#levelIdx <= 0) Logger.#printMessages(this.name ?? "App", msg, context, "trace");
|
|
87
|
-
}
|
|
88
|
-
verbose(msg, context = "") {
|
|
89
|
-
if (Logger.#levelIdx <= 1) Logger.#printMessages(this.name ?? "App", msg, context, "verbose");
|
|
90
|
-
}
|
|
91
|
-
debug(msg, context = "") {
|
|
92
|
-
if (Logger.#levelIdx <= 2) Logger.#printMessages(this.name ?? "App", msg, context, "debug");
|
|
93
|
-
}
|
|
94
|
-
log(msg, context = "") {
|
|
95
|
-
if (Logger.#levelIdx <= 3) Logger.#printMessages(this.name ?? "App", msg, context, "log");
|
|
96
|
-
}
|
|
97
|
-
info(msg, context = "") {
|
|
98
|
-
if (Logger.#levelIdx <= 4) Logger.#printMessages(this.name ?? "App", msg, context, "info");
|
|
99
|
-
}
|
|
100
|
-
warn(msg, context = "") {
|
|
101
|
-
if (Logger.#levelIdx <= 5) Logger.#printMessages(this.name ?? "App", msg, context, "warn");
|
|
102
|
-
}
|
|
103
|
-
error(msg, context = "") {
|
|
104
|
-
if (Logger.#levelIdx <= 6) Logger.#printMessages(this.name ?? "App", msg, context, "error");
|
|
105
|
-
}
|
|
106
|
-
raw(msg, method) {
|
|
107
|
-
Logger.rawLog(msg, method);
|
|
108
|
-
}
|
|
109
|
-
rawLog(msg, method) {
|
|
110
|
-
Logger.rawLog(msg, method);
|
|
111
|
-
}
|
|
112
|
-
static trace(msg, context = "") {
|
|
113
|
-
if (Logger.#levelIdx <= 0) Logger.#printMessages("App", msg, context, "trace");
|
|
114
|
-
}
|
|
115
|
-
static verbose(msg, context = "") {
|
|
116
|
-
if (Logger.#levelIdx <= 1) Logger.#printMessages("App", msg, context, "verbose");
|
|
117
|
-
}
|
|
118
|
-
static debug(msg, context = "") {
|
|
119
|
-
if (Logger.#levelIdx <= 2) Logger.#printMessages("App", msg, context, "debug");
|
|
120
|
-
}
|
|
121
|
-
static log(msg, context = "") {
|
|
122
|
-
if (Logger.#levelIdx <= 3) Logger.#printMessages("App", msg, context, "log");
|
|
123
|
-
}
|
|
124
|
-
static info(msg, context = "") {
|
|
125
|
-
if (Logger.#levelIdx <= 4) Logger.#printMessages("App", msg, context, "info");
|
|
126
|
-
}
|
|
127
|
-
static warn(msg, context = "") {
|
|
128
|
-
if (Logger.#levelIdx <= 5) Logger.#printMessages("App", msg, context, "warn");
|
|
129
|
-
}
|
|
130
|
-
static error(msg, context = "") {
|
|
131
|
-
if (Logger.#levelIdx <= 6) Logger.#printMessages("App", msg, context, "error");
|
|
132
|
-
}
|
|
133
|
-
static #colorize(msg, logLevel) {
|
|
134
|
-
return colorizeMap[logLevel](msg);
|
|
135
|
-
}
|
|
136
|
-
static #printMessages(name, content, context, logLevel, writeStreamType = logLevel === "error" ? "stderr" : "stdout") {
|
|
137
|
-
if (this.#ignoreCtxSet.has(context)) return;
|
|
138
|
-
const now = (0, import_dayjs.default)();
|
|
139
|
-
const processMsg = this.#colorize(`[${name ?? "App"}] ${global.process?.pid ?? "window"} -`, logLevel);
|
|
140
|
-
const timestampMsg = now.format("MM/DD/YYYY, HH:mm:ss A");
|
|
141
|
-
const logLevelMsg = this.#colorize(logLevel.toUpperCase().padStart(7, " "), logLevel);
|
|
142
|
-
const contextMsg = context ? clc.yellow(`[${context}] `) : "";
|
|
143
|
-
const contentMsg = this.#colorize(content, logLevel);
|
|
144
|
-
const timeDiffMsg = clc.yellow(`+${now.diff(Logger.#startAt, "ms")}ms`);
|
|
145
|
-
if (typeof window === "undefined") process[writeStreamType].write(`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
146
|
-
`);
|
|
147
|
-
else console.log(`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
148
|
-
`);
|
|
149
|
-
}
|
|
150
|
-
static rawLog(msg, method) {
|
|
151
|
-
this.raw(`${msg}
|
|
152
|
-
`, method);
|
|
153
|
-
}
|
|
154
|
-
static raw(msg, method) {
|
|
155
|
-
if (typeof window === "undefined" && method !== "console" && global.process) global.process.stdout.write(msg);
|
|
156
|
-
else console.log(msg);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
160
|
-
0 && (module.exports = {
|
|
161
|
-
Logger
|
|
162
|
-
});
|
package/src/applyMixins.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var applyMixins_exports = {};
|
|
20
|
-
__export(applyMixins_exports, {
|
|
21
|
-
applyMixins: () => applyMixins
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(applyMixins_exports);
|
|
24
|
-
const getAllPropertyDescriptors = /* @__PURE__ */ __name((objRef) => {
|
|
25
|
-
const descriptors = {};
|
|
26
|
-
let current = objRef.prototype;
|
|
27
|
-
while (current) {
|
|
28
|
-
Object.getOwnPropertyNames(current).forEach((name) => {
|
|
29
|
-
descriptors[name] ??= Object.getOwnPropertyDescriptor(current, name);
|
|
30
|
-
});
|
|
31
|
-
current = Object.getPrototypeOf(current);
|
|
32
|
-
}
|
|
33
|
-
return descriptors;
|
|
34
|
-
}, "getAllPropertyDescriptors");
|
|
35
|
-
const applyMixins = /* @__PURE__ */ __name((derivedCtor, constructors, avoidKeys) => {
|
|
36
|
-
constructors.forEach((baseCtor) => {
|
|
37
|
-
Object.entries(getAllPropertyDescriptors(baseCtor)).forEach(([name, descriptor]) => {
|
|
38
|
-
if (name === "constructor" || avoidKeys?.has(name)) return;
|
|
39
|
-
Object.defineProperty(derivedCtor.prototype, name, {
|
|
40
|
-
...descriptor,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}, "applyMixins");
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
applyMixins
|
|
49
|
-
});
|
package/src/capitalize.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var capitalize_exports = {};
|
|
20
|
-
__export(capitalize_exports, {
|
|
21
|
-
capitalize: () => capitalize
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(capitalize_exports);
|
|
24
|
-
const capitalize = /* @__PURE__ */ __name((str) => {
|
|
25
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
26
|
-
}, "capitalize");
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
capitalize
|
|
30
|
-
});
|
package/src/deepObjectify.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var deepObjectify_exports = {};
|
|
20
|
-
__export(deepObjectify_exports, {
|
|
21
|
-
deepObjectify: () => deepObjectify
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(deepObjectify_exports);
|
|
24
|
-
var import_isDayjs = require("./isDayjs");
|
|
25
|
-
const deepObjectify = /* @__PURE__ */ __name((obj, option = {}) => {
|
|
26
|
-
if ((0, import_isDayjs.isDayjs)(obj) || obj?.constructor === Date) {
|
|
27
|
-
if (!option.serializable && !option.convertDate) return obj;
|
|
28
|
-
if (option.convertDate === "string") return obj.toISOString();
|
|
29
|
-
else if (option.convertDate === "number") return (0, import_isDayjs.isDayjs)(obj) ? obj.toDate().getTime() : obj.getTime();
|
|
30
|
-
else return (0, import_isDayjs.isDayjs)(obj) ? obj.toDate() : obj;
|
|
31
|
-
} else if (Array.isArray(obj)) {
|
|
32
|
-
return obj.map((o) => deepObjectify(o, option));
|
|
33
|
-
} else if (obj && typeof obj === "object") {
|
|
34
|
-
const val = {};
|
|
35
|
-
Object.keys(obj).forEach((key) => {
|
|
36
|
-
const fieldValue = obj[key];
|
|
37
|
-
if (fieldValue?.__ModelType__ && !option.serializable) val[key] = fieldValue;
|
|
38
|
-
else if (typeof obj[key] !== "function") val[key] = deepObjectify(fieldValue, option);
|
|
39
|
-
});
|
|
40
|
-
return val;
|
|
41
|
-
} else {
|
|
42
|
-
return obj;
|
|
43
|
-
}
|
|
44
|
-
}, "deepObjectify");
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
deepObjectify
|
|
48
|
-
});
|
package/src/index.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var src_exports = {};
|
|
19
|
-
__export(src_exports, {
|
|
20
|
-
Logger: () => import_Logger.Logger,
|
|
21
|
-
applyMixins: () => import_applyMixins.applyMixins,
|
|
22
|
-
capitalize: () => import_capitalize.capitalize,
|
|
23
|
-
deepObjectify: () => import_deepObjectify.deepObjectify,
|
|
24
|
-
isDayjs: () => import_isDayjs.isDayjs,
|
|
25
|
-
isQueryEqual: () => import_isQueryEqual.isQueryEqual,
|
|
26
|
-
isValidDate: () => import_isValidDate.isValidDate,
|
|
27
|
-
lowerlize: () => import_lowerlize.lowerlize,
|
|
28
|
-
mergeVersion: () => import_mergeVersion.mergeVersion,
|
|
29
|
-
objectify: () => import_objectify.objectify,
|
|
30
|
-
pathGet: () => import_pathGet.pathGet,
|
|
31
|
-
pathSet: () => import_pathSet.pathSet,
|
|
32
|
-
pluralize: () => import_pluralize.pluralize,
|
|
33
|
-
randomPick: () => import_randomPick.randomPick,
|
|
34
|
-
randomPicks: () => import_randomPicks.randomPicks,
|
|
35
|
-
sleep: () => import_sleep.sleep,
|
|
36
|
-
splitVersion: () => import_splitVersion.splitVersion
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(src_exports);
|
|
39
|
-
var import_splitVersion = require("./splitVersion");
|
|
40
|
-
var import_deepObjectify = require("./deepObjectify");
|
|
41
|
-
var import_pathGet = require("./pathGet");
|
|
42
|
-
var import_isQueryEqual = require("./isQueryEqual");
|
|
43
|
-
var import_isValidDate = require("./isValidDate");
|
|
44
|
-
var import_objectify = require("./objectify");
|
|
45
|
-
var import_randomPick = require("./randomPick");
|
|
46
|
-
var import_randomPicks = require("./randomPicks");
|
|
47
|
-
var import_pathSet = require("./pathSet");
|
|
48
|
-
var import_isDayjs = require("./isDayjs");
|
|
49
|
-
var import_mergeVersion = require("./mergeVersion");
|
|
50
|
-
var import_pluralize = require("./pluralize");
|
|
51
|
-
var import_applyMixins = require("./applyMixins");
|
|
52
|
-
var import_capitalize = require("./capitalize");
|
|
53
|
-
var import_Logger = require("./Logger");
|
|
54
|
-
var import_lowerlize = require("./lowerlize");
|
|
55
|
-
var import_sleep = require("./sleep");
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
Logger,
|
|
59
|
-
applyMixins,
|
|
60
|
-
capitalize,
|
|
61
|
-
deepObjectify,
|
|
62
|
-
isDayjs,
|
|
63
|
-
isQueryEqual,
|
|
64
|
-
isValidDate,
|
|
65
|
-
lowerlize,
|
|
66
|
-
mergeVersion,
|
|
67
|
-
objectify,
|
|
68
|
-
pathGet,
|
|
69
|
-
pathSet,
|
|
70
|
-
pluralize,
|
|
71
|
-
randomPick,
|
|
72
|
-
randomPicks,
|
|
73
|
-
sleep,
|
|
74
|
-
splitVersion
|
|
75
|
-
});
|
package/src/isDayjs.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var isDayjs_exports = {};
|
|
19
|
-
__export(isDayjs_exports, {
|
|
20
|
-
isDayjs: () => import_dayjs.isDayjs
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(isDayjs_exports);
|
|
23
|
-
var import_dayjs = require("dayjs");
|
|
24
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
-
0 && (module.exports = {
|
|
26
|
-
isDayjs
|
|
27
|
-
});
|
package/src/isQueryEqual.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var isQueryEqual_exports = {};
|
|
30
|
-
__export(isQueryEqual_exports, {
|
|
31
|
-
isQueryEqual: () => isQueryEqual
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(isQueryEqual_exports);
|
|
34
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
35
|
-
var import_isDayjs = require("./isDayjs");
|
|
36
|
-
const isQueryEqual = /* @__PURE__ */ __name((value1, value2) => {
|
|
37
|
-
if (value1 === value2) return true;
|
|
38
|
-
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
39
|
-
if (value1.length !== value2.length) return false;
|
|
40
|
-
for (let i = 0; i < value1.length; i++) if (!isQueryEqual(value1[i], value2[i])) return false;
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
if ([
|
|
44
|
-
value1,
|
|
45
|
-
value2
|
|
46
|
-
].some((val) => val instanceof Date || (0, import_isDayjs.isDayjs)(val))) return (0, import_dayjs.default)(value1).isSame((0, import_dayjs.default)(value2));
|
|
47
|
-
if (typeof value1 === "object" && typeof value2 === "object") {
|
|
48
|
-
if (value1 === null || value2 === null) return value1 === value2;
|
|
49
|
-
if (Object.keys(value1).length !== Object.keys(value2).length) return false;
|
|
50
|
-
for (const key of Object.keys(value1)) if (!isQueryEqual(value1[key], value2[key])) return false;
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
}, "isQueryEqual");
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
isQueryEqual
|
|
58
|
-
});
|
package/src/isValidDate.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var isValidDate_exports = {};
|
|
30
|
-
__export(isValidDate_exports, {
|
|
31
|
-
isValidDate: () => isValidDate
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(isValidDate_exports);
|
|
34
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
35
|
-
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
|
|
36
|
-
var import_isDayjs = require("./isDayjs");
|
|
37
|
-
import_dayjs.default.extend(import_customParseFormat.default);
|
|
38
|
-
const isValidDate = /* @__PURE__ */ __name((d) => {
|
|
39
|
-
const format = "YYYY-MM-DD";
|
|
40
|
-
if (typeof d === "string") {
|
|
41
|
-
return (0, import_dayjs.default)(d, format).isValid();
|
|
42
|
-
} else if ((0, import_isDayjs.isDayjs)(d)) return d.isValid();
|
|
43
|
-
else return d instanceof Date && !isNaN(d.getTime());
|
|
44
|
-
}, "isValidDate");
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
isValidDate
|
|
48
|
-
});
|
package/src/lowerlize.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var lowerlize_exports = {};
|
|
20
|
-
__export(lowerlize_exports, {
|
|
21
|
-
lowerlize: () => lowerlize
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(lowerlize_exports);
|
|
24
|
-
const lowerlize = /* @__PURE__ */ __name((str) => {
|
|
25
|
-
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
26
|
-
}, "lowerlize");
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
lowerlize
|
|
30
|
-
});
|
package/src/mergeVersion.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var mergeVersion_exports = {};
|
|
20
|
-
__export(mergeVersion_exports, {
|
|
21
|
-
mergeVersion: () => mergeVersion
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(mergeVersion_exports);
|
|
24
|
-
const mergeVersion = /* @__PURE__ */ __name((major, minor, patch) => `${major}.${minor}.${patch}`, "mergeVersion");
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
mergeVersion
|
|
28
|
-
});
|
package/src/objectify.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var objectify_exports = {};
|
|
20
|
-
__export(objectify_exports, {
|
|
21
|
-
objectify: () => objectify
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(objectify_exports);
|
|
24
|
-
const objectify = /* @__PURE__ */ __name((obj, keys = Object.keys(obj)) => {
|
|
25
|
-
const val = {};
|
|
26
|
-
keys.forEach((key) => {
|
|
27
|
-
if (typeof obj[key] !== "function") val[key] = obj[key];
|
|
28
|
-
});
|
|
29
|
-
return val;
|
|
30
|
-
}, "objectify");
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
objectify
|
|
34
|
-
});
|
package/src/pathGet.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var pathGet_exports = {};
|
|
20
|
-
__export(pathGet_exports, {
|
|
21
|
-
pathGet: () => pathGet
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(pathGet_exports);
|
|
24
|
-
const pathGet = /* @__PURE__ */ __name((path, obj, separator = ".") => {
|
|
25
|
-
const properties = Array.isArray(path) ? path : path.split(separator);
|
|
26
|
-
return properties.reduce((prev, curr) => prev[curr], obj);
|
|
27
|
-
}, "pathGet");
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
pathGet
|
|
31
|
-
});
|
package/src/pathSet.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var pathSet_exports = {};
|
|
20
|
-
__export(pathSet_exports, {
|
|
21
|
-
pathSet: () => pathSet
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(pathSet_exports);
|
|
24
|
-
const pathSet = /* @__PURE__ */ __name((obj, path, value) => {
|
|
25
|
-
if (Object(obj) !== obj) return obj;
|
|
26
|
-
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
|
|
27
|
-
path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
|
|
28
|
-
return obj;
|
|
29
|
-
}, "pathSet");
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
pathSet
|
|
33
|
-
});
|