@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/isQueryEqual.cjs
DELETED
|
@@ -1,59 +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 __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
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 isQueryEqual_exports = {};
|
|
29
|
-
__export(isQueryEqual_exports, {
|
|
30
|
-
isQueryEqual: () => isQueryEqual
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(isQueryEqual_exports);
|
|
33
|
-
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
34
|
-
var import_isDayjs = require("./isDayjs");
|
|
35
|
-
const isQueryEqual = (value1, value2) => {
|
|
36
|
-
if (value1 === value2)
|
|
37
|
-
return true;
|
|
38
|
-
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
39
|
-
if (value1.length !== value2.length)
|
|
40
|
-
return false;
|
|
41
|
-
for (let i = 0; i < value1.length; i++)
|
|
42
|
-
if (!isQueryEqual(value1[i], value2[i]))
|
|
43
|
-
return false;
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
if ([value1, value2].some((val) => val instanceof Date || (0, import_isDayjs.isDayjs)(val)))
|
|
47
|
-
return (0, import_dayjs.default)(value1).isSame((0, import_dayjs.default)(value2));
|
|
48
|
-
if (typeof value1 === "object" && typeof value2 === "object") {
|
|
49
|
-
if (value1 === null || value2 === null)
|
|
50
|
-
return value1 === value2;
|
|
51
|
-
if (Object.keys(value1).length !== Object.keys(value2).length)
|
|
52
|
-
return false;
|
|
53
|
-
for (const key of Object.keys(value1))
|
|
54
|
-
if (!isQueryEqual(value1[key], value2[key]))
|
|
55
|
-
return false;
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
};
|
package/isValidDate.cjs
DELETED
|
@@ -1,45 +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 __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
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 isValidDate_exports = {};
|
|
29
|
-
__export(isValidDate_exports, {
|
|
30
|
-
isValidDate: () => isValidDate
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(isValidDate_exports);
|
|
33
|
-
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
34
|
-
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"), 1);
|
|
35
|
-
var import_isDayjs = require("./isDayjs");
|
|
36
|
-
import_dayjs.default.extend(import_customParseFormat.default);
|
|
37
|
-
const isValidDate = (d) => {
|
|
38
|
-
const format = "YYYY-MM-DD";
|
|
39
|
-
if (typeof d === "string") {
|
|
40
|
-
return (0, import_dayjs.default)(d, format).isValid();
|
|
41
|
-
} else if ((0, import_isDayjs.isDayjs)(d))
|
|
42
|
-
return d.isValid();
|
|
43
|
-
else
|
|
44
|
-
return d instanceof Date && !isNaN(d.getTime());
|
|
45
|
-
};
|
package/lowerlize.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 lowerlize_exports = {};
|
|
19
|
-
__export(lowerlize_exports, {
|
|
20
|
-
lowerlize: () => lowerlize
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(lowerlize_exports);
|
|
23
|
-
const lowerlize = (str) => {
|
|
24
|
-
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
25
|
-
};
|
package/mergeVersion.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 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/objectify.cjs
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 __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);
|
|
23
|
-
const objectify = (obj, keys = Object.keys(obj)) => {
|
|
24
|
-
const val = {};
|
|
25
|
-
keys.forEach((key) => {
|
|
26
|
-
if (typeof obj[key] !== "function")
|
|
27
|
-
val[key] = obj[key];
|
|
28
|
-
});
|
|
29
|
-
return val;
|
|
30
|
-
};
|
package/pathGet.cjs
DELETED
|
@@ -1,26 +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 pathGet_exports = {};
|
|
19
|
-
__export(pathGet_exports, {
|
|
20
|
-
pathGet: () => pathGet
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(pathGet_exports);
|
|
23
|
-
const pathGet = (path, obj, separator = ".") => {
|
|
24
|
-
const properties = Array.isArray(path) ? path : path.split(separator);
|
|
25
|
-
return properties.reduce((prev, curr) => prev[curr], obj);
|
|
26
|
-
};
|
package/pathSet.cjs
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 __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);
|
|
23
|
-
const pathSet = (obj, path, value) => {
|
|
24
|
-
if (Object(obj) !== obj)
|
|
25
|
-
return obj;
|
|
26
|
-
if (!Array.isArray(path))
|
|
27
|
-
path = path.toString().match(/[^.[\]]+/g) || [];
|
|
28
|
-
path.slice(0, -1).reduce(
|
|
29
|
-
(a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {},
|
|
30
|
-
obj
|
|
31
|
-
)[path[path.length - 1]] = value;
|
|
32
|
-
return obj;
|
|
33
|
-
};
|
package/pluralize.cjs
DELETED
|
@@ -1,33 +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 __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
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"), 1);
|
package/randomPick.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 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/randomPicks.cjs
DELETED
|
@@ -1,35 +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 randomPicks_exports = {};
|
|
19
|
-
__export(randomPicks_exports, {
|
|
20
|
-
randomPicks: () => randomPicks
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(randomPicks_exports);
|
|
23
|
-
const randomPicks = (arr, count = 1, allowDuplicate = false) => {
|
|
24
|
-
if (!allowDuplicate && arr.length <= count)
|
|
25
|
-
return arr;
|
|
26
|
-
const idxs = [];
|
|
27
|
-
let pickIdx;
|
|
28
|
-
for (let i = 0; i < count; i++) {
|
|
29
|
-
do {
|
|
30
|
-
pickIdx = Math.floor(Math.random() * arr.length);
|
|
31
|
-
} while (!allowDuplicate && idxs.includes(pickIdx));
|
|
32
|
-
idxs.push(pickIdx);
|
|
33
|
-
}
|
|
34
|
-
return idxs.map((idx) => arr[idx]);
|
|
35
|
-
};
|
package/sleep.cjs
DELETED
|
@@ -1,29 +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 sleep_exports = {};
|
|
19
|
-
__export(sleep_exports, {
|
|
20
|
-
sleep: () => sleep
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(sleep_exports);
|
|
23
|
-
const sleep = async (ms) => {
|
|
24
|
-
return new Promise((resolve) => {
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
resolve(true);
|
|
27
|
-
}, ms);
|
|
28
|
-
});
|
|
29
|
-
};
|
package/splitVersion.cjs
DELETED
|
@@ -1,26 +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 splitVersion_exports = {};
|
|
19
|
-
__export(splitVersion_exports, {
|
|
20
|
-
splitVersion: () => splitVersion
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(splitVersion_exports);
|
|
23
|
-
const splitVersion = (version) => {
|
|
24
|
-
const [major, minor, patch] = version.split(".");
|
|
25
|
-
return { major, minor, patch };
|
|
26
|
-
};
|
package/types.cjs
DELETED
|
@@ -1,15 +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 __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);
|