@akanjs/common 0.0.102 → 0.0.103
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/Logger.js +35 -6
- package/{Logger.cjs → Logger.mjs} +6 -35
- package/applyMixins.js +22 -3
- package/applyMixins.mjs +23 -0
- package/capitalize.js +22 -3
- package/capitalize.mjs +6 -0
- package/deepObjectify.js +26 -7
- package/deepObjectify.mjs +30 -0
- package/index.js +54 -35
- package/index.mjs +36 -0
- package/isDayjs.js +22 -3
- package/isDayjs.mjs +4 -0
- package/isQueryEqual.js +36 -7
- package/isQueryEqual.mjs +30 -0
- package/isValidDate.js +38 -9
- package/isValidDate.mjs +16 -0
- package/lowerlize.js +22 -3
- package/lowerlize.mjs +6 -0
- package/mergeVersion.js +22 -3
- package/mergeVersion.mjs +4 -0
- package/objectify.js +22 -3
- package/objectify.mjs +11 -0
- package/package.json +4 -4
- package/pathGet.js +22 -3
- package/pathGet.mjs +7 -0
- package/pathSet.js +22 -3
- package/pathSet.mjs +14 -0
- package/pluralize.js +32 -3
- package/pluralize.mjs +4 -0
- package/randomPick.js +22 -3
- package/randomPick.mjs +4 -0
- package/randomPicks.js +22 -3
- package/randomPicks.mjs +16 -0
- package/sleep.js +22 -3
- package/sleep.mjs +10 -0
- package/splitVersion.js +22 -3
- package/splitVersion.mjs +7 -0
- package/types.js +15 -0
- package/types.mjs +0 -0
- package/applyMixins.cjs +0 -42
- package/capitalize.cjs +0 -25
- package/deepObjectify.cjs +0 -49
- package/index.cjs +0 -55
- package/isDayjs.cjs +0 -23
- package/isQueryEqual.cjs +0 -59
- package/isValidDate.cjs +0 -45
- package/lowerlize.cjs +0 -25
- package/mergeVersion.cjs +0 -23
- package/objectify.cjs +0 -30
- package/pathGet.cjs +0 -26
- package/pathSet.cjs +0 -33
- package/pluralize.cjs +0 -33
- package/randomPick.cjs +0 -23
- package/randomPicks.cjs +0 -35
- package/sleep.cjs +0 -29
- package/splitVersion.cjs +0 -26
- package/types.cjs +0 -15
package/mergeVersion.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
4
16
|
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var mergeVersion_exports = {};
|
|
19
|
+
__export(mergeVersion_exports, {
|
|
20
|
+
mergeVersion: () => mergeVersion
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(mergeVersion_exports);
|
|
23
|
+
const mergeVersion = (major, minor, patch) => `${major}.${minor}.${patch}`;
|
package/mergeVersion.mjs
ADDED
package/objectify.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
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 objectify_exports = {};
|
|
19
|
+
__export(objectify_exports, {
|
|
20
|
+
objectify: () => objectify
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(objectify_exports);
|
|
1
23
|
const objectify = (obj, keys = Object.keys(obj)) => {
|
|
2
24
|
const val = {};
|
|
3
25
|
keys.forEach((key) => {
|
|
@@ -6,6 +28,3 @@ const objectify = (obj, keys = Object.keys(obj)) => {
|
|
|
6
28
|
});
|
|
7
29
|
return val;
|
|
8
30
|
};
|
|
9
|
-
export {
|
|
10
|
-
objectify
|
|
11
|
-
};
|
package/objectify.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/common",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "0.0.103",
|
|
4
|
+
"type": "commonjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
|
-
"require": "./index.
|
|
24
|
-
"import": "./index.
|
|
23
|
+
"require": "./index.js",
|
|
24
|
+
"import": "./index.mjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"esbuild": {
|
package/pathGet.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
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 pathGet_exports = {};
|
|
19
|
+
__export(pathGet_exports, {
|
|
20
|
+
pathGet: () => pathGet
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pathGet_exports);
|
|
1
23
|
const pathGet = (path, obj, separator = ".") => {
|
|
2
24
|
const properties = Array.isArray(path) ? path : path.split(separator);
|
|
3
25
|
return properties.reduce((prev, curr) => prev[curr], obj);
|
|
4
26
|
};
|
|
5
|
-
export {
|
|
6
|
-
pathGet
|
|
7
|
-
};
|
package/pathGet.mjs
ADDED
package/pathSet.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
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 pathSet_exports = {};
|
|
19
|
+
__export(pathSet_exports, {
|
|
20
|
+
pathSet: () => pathSet
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pathSet_exports);
|
|
1
23
|
const pathSet = (obj, path, value) => {
|
|
2
24
|
if (Object(obj) !== obj)
|
|
3
25
|
return obj;
|
|
@@ -9,6 +31,3 @@ const pathSet = (obj, path, value) => {
|
|
|
9
31
|
)[path[path.length - 1]] = value;
|
|
10
32
|
return obj;
|
|
11
33
|
};
|
|
12
|
-
export {
|
|
13
|
-
pathSet
|
|
14
|
-
};
|
package/pathSet.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const pathSet = (obj, path, value) => {
|
|
2
|
+
if (Object(obj) !== obj)
|
|
3
|
+
return obj;
|
|
4
|
+
if (!Array.isArray(path))
|
|
5
|
+
path = path.toString().match(/[^.[\]]+/g) || [];
|
|
6
|
+
path.slice(0, -1).reduce(
|
|
7
|
+
(a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {},
|
|
8
|
+
obj
|
|
9
|
+
)[path[path.length - 1]] = value;
|
|
10
|
+
return obj;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
pathSet
|
|
14
|
+
};
|
package/pluralize.js
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
10
|
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var pluralize_exports = {};
|
|
29
|
+
__export(pluralize_exports, {
|
|
30
|
+
pluralize: () => import_pluralize.default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(pluralize_exports);
|
|
33
|
+
var import_pluralize = __toESM(require("pluralize"));
|
package/pluralize.mjs
ADDED
package/randomPick.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
4
16
|
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var randomPick_exports = {};
|
|
19
|
+
__export(randomPick_exports, {
|
|
20
|
+
randomPick: () => randomPick
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(randomPick_exports);
|
|
23
|
+
const randomPick = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
package/randomPick.mjs
ADDED
package/randomPicks.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
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 randomPicks_exports = {};
|
|
19
|
+
__export(randomPicks_exports, {
|
|
20
|
+
randomPicks: () => randomPicks
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(randomPicks_exports);
|
|
1
23
|
const randomPicks = (arr, count = 1, allowDuplicate = false) => {
|
|
2
24
|
if (!allowDuplicate && arr.length <= count)
|
|
3
25
|
return arr;
|
|
@@ -11,6 +33,3 @@ const randomPicks = (arr, count = 1, allowDuplicate = false) => {
|
|
|
11
33
|
}
|
|
12
34
|
return idxs.map((idx) => arr[idx]);
|
|
13
35
|
};
|
|
14
|
-
export {
|
|
15
|
-
randomPicks
|
|
16
|
-
};
|
package/randomPicks.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const randomPicks = (arr, count = 1, allowDuplicate = false) => {
|
|
2
|
+
if (!allowDuplicate && arr.length <= count)
|
|
3
|
+
return arr;
|
|
4
|
+
const idxs = [];
|
|
5
|
+
let pickIdx;
|
|
6
|
+
for (let i = 0; i < count; i++) {
|
|
7
|
+
do {
|
|
8
|
+
pickIdx = Math.floor(Math.random() * arr.length);
|
|
9
|
+
} while (!allowDuplicate && idxs.includes(pickIdx));
|
|
10
|
+
idxs.push(pickIdx);
|
|
11
|
+
}
|
|
12
|
+
return idxs.map((idx) => arr[idx]);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
randomPicks
|
|
16
|
+
};
|
package/sleep.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
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 sleep_exports = {};
|
|
19
|
+
__export(sleep_exports, {
|
|
20
|
+
sleep: () => sleep
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(sleep_exports);
|
|
1
23
|
const sleep = async (ms) => {
|
|
2
24
|
return new Promise((resolve) => {
|
|
3
25
|
setTimeout(() => {
|
|
@@ -5,6 +27,3 @@ const sleep = async (ms) => {
|
|
|
5
27
|
}, ms);
|
|
6
28
|
});
|
|
7
29
|
};
|
|
8
|
-
export {
|
|
9
|
-
sleep
|
|
10
|
-
};
|
package/sleep.mjs
ADDED
package/splitVersion.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
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 splitVersion_exports = {};
|
|
19
|
+
__export(splitVersion_exports, {
|
|
20
|
+
splitVersion: () => splitVersion
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(splitVersion_exports);
|
|
1
23
|
const splitVersion = (version) => {
|
|
2
24
|
const [major, minor, patch] = version.split(".");
|
|
3
25
|
return { major, minor, patch };
|
|
4
26
|
};
|
|
5
|
-
export {
|
|
6
|
-
splitVersion
|
|
7
|
-
};
|
package/splitVersion.mjs
ADDED
package/types.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
package/types.mjs
ADDED
|
File without changes
|
package/applyMixins.cjs
DELETED
|
@@ -1,42 +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 applyMixins_exports = {};
|
|
19
|
-
__export(applyMixins_exports, {
|
|
20
|
-
applyMixins: () => applyMixins
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(applyMixins_exports);
|
|
23
|
-
const getAllPropertyDescriptors = (objRef) => {
|
|
24
|
-
const descriptors = {};
|
|
25
|
-
let current = objRef.prototype;
|
|
26
|
-
while (current) {
|
|
27
|
-
Object.getOwnPropertyNames(current).forEach((name) => {
|
|
28
|
-
descriptors[name] ??= Object.getOwnPropertyDescriptor(current, name);
|
|
29
|
-
});
|
|
30
|
-
current = Object.getPrototypeOf(current);
|
|
31
|
-
}
|
|
32
|
-
return descriptors;
|
|
33
|
-
};
|
|
34
|
-
const applyMixins = (derivedCtor, constructors, avoidKeys) => {
|
|
35
|
-
constructors.forEach((baseCtor) => {
|
|
36
|
-
Object.entries(getAllPropertyDescriptors(baseCtor)).forEach(([name, descriptor]) => {
|
|
37
|
-
if (name === "constructor" || avoidKeys?.has(name))
|
|
38
|
-
return;
|
|
39
|
-
Object.defineProperty(derivedCtor.prototype, name, { ...descriptor, configurable: true });
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
};
|
package/capitalize.cjs
DELETED
|
@@ -1,25 +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 capitalize_exports = {};
|
|
19
|
-
__export(capitalize_exports, {
|
|
20
|
-
capitalize: () => capitalize
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(capitalize_exports);
|
|
23
|
-
const capitalize = (str) => {
|
|
24
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
25
|
-
};
|
package/deepObjectify.cjs
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 __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 deepObjectify_exports = {};
|
|
19
|
-
__export(deepObjectify_exports, {
|
|
20
|
-
deepObjectify: () => deepObjectify
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(deepObjectify_exports);
|
|
23
|
-
var import_isDayjs = require("./isDayjs");
|
|
24
|
-
const deepObjectify = (obj, option = {}) => {
|
|
25
|
-
if ((0, import_isDayjs.isDayjs)(obj) || obj?.constructor === Date) {
|
|
26
|
-
if (!option.serializable && !option.convertDate)
|
|
27
|
-
return obj;
|
|
28
|
-
if (option.convertDate === "string")
|
|
29
|
-
return obj.toISOString();
|
|
30
|
-
else if (option.convertDate === "number")
|
|
31
|
-
return (0, import_isDayjs.isDayjs)(obj) ? obj.toDate().getTime() : obj.getTime();
|
|
32
|
-
else
|
|
33
|
-
return (0, import_isDayjs.isDayjs)(obj) ? obj.toDate() : obj;
|
|
34
|
-
} else if (Array.isArray(obj)) {
|
|
35
|
-
return obj.map((o) => deepObjectify(o, option));
|
|
36
|
-
} else if (obj && typeof obj === "object") {
|
|
37
|
-
const val = {};
|
|
38
|
-
Object.keys(obj).forEach((key) => {
|
|
39
|
-
const fieldValue = obj[key];
|
|
40
|
-
if (fieldValue?.__ModelType__ && !option.serializable)
|
|
41
|
-
val[key] = fieldValue;
|
|
42
|
-
else if (typeof obj[key] !== "function")
|
|
43
|
-
val[key] = deepObjectify(fieldValue, option);
|
|
44
|
-
});
|
|
45
|
-
return val;
|
|
46
|
-
} else {
|
|
47
|
-
return obj;
|
|
48
|
-
}
|
|
49
|
-
};
|
package/index.cjs
DELETED
|
@@ -1,55 +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 common_exports = {};
|
|
19
|
-
__export(common_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(common_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");
|
package/isDayjs.cjs
DELETED
|
@@ -1,23 +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");
|