@akanjs/common 0.0.34 → 0.0.35

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/src/capitalize.js 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 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
- };
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
28
- capitalize
29
- });
@@ -1,4 +0,0 @@
1
- export declare const deepObjectify: <T = any>(obj: T | null | undefined, option?: {
2
- serializable?: boolean;
3
- convertDate?: "string" | "number";
4
- }) => T;
@@ -1,53 +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
- };
50
- // Annotate the CommonJS export names for ESM import in node:
51
- 0 && (module.exports = {
52
- deepObjectify
53
- });
package/src/index.d.ts DELETED
@@ -1,18 +0,0 @@
1
- export type * from "./types";
2
- export { splitVersion } from "./splitVersion";
3
- export { deepObjectify } from "./deepObjectify";
4
- export { pathGet } from "./pathGet";
5
- export { isQueryEqual } from "./isQueryEqual";
6
- export { isValidDate } from "./isValidDate";
7
- export { objectify } from "./objectify";
8
- export { randomPick } from "./randomPick";
9
- export { randomPicks } from "./randomPicks";
10
- export { pathSet } from "./pathSet";
11
- export { isDayjs } from "./isDayjs";
12
- export { mergeVersion } from "./mergeVersion";
13
- export { pluralize } from "./pluralize";
14
- export { applyMixins } from "./applyMixins";
15
- export { capitalize } from "./capitalize";
16
- export { Logger } from "./Logger";
17
- export { lowerlize } from "./lowerlize";
18
- export { sleep } from "./sleep";
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.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { isDayjs } from "dayjs";
2
- export { isDayjs };
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
- });
@@ -1 +0,0 @@
1
- export declare const isQueryEqual: (value1: object | null, value2: object | null) => boolean;
@@ -1,63 +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"));
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
- };
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- isQueryEqual
63
- });
@@ -1,2 +0,0 @@
1
- import { Dayjs } from "dayjs";
2
- export declare const isValidDate: (d: string | Date | Dayjs) => boolean;
@@ -1,49 +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"));
34
- var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
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
- };
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- isValidDate
49
- });
@@ -1 +0,0 @@
1
- export declare const lowerlize: (str: string) => string;
package/src/lowerlize.js 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 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
- };
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
28
- lowerlize
29
- });
@@ -1,10 +0,0 @@
1
- /**
2
- *
3
- * semantic version 규격에 맞게 조합하는 함수
4
- * https://semver.org/
5
- * @param major 릴리즈(플랫폼(google,apple,etc...)에 올라가 있는) 버전
6
- * @param minor 릴리즈(플랫폼(google,apple,etc...)에 올라가 있는) 버전
7
- * @param patch 코드푸시 (Framework 자체 버전)
8
- * @returns `major.minor.patch` 형식으로 조합된 버전
9
- */
10
- export declare const mergeVersion: (major: number, minor: number, patch: number) => string;
@@ -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 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}`;
24
- // Annotate the CommonJS export names for ESM import in node:
25
- 0 && (module.exports = {
26
- mergeVersion
27
- });
@@ -1 +0,0 @@
1
- export declare const objectify: (obj: any, keys?: string[]) => any;
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 __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
- };
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- objectify
34
- });
package/src/pathGet.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const pathGet: (path: string | (string | number)[], obj: any, separator?: string) => unknown;
package/src/pathGet.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 __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
- };
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- pathGet
30
- });
package/src/pathSet.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const pathSet: (obj: any, path: any, value: any) => any;
package/src/pathSet.js DELETED
@@ -1,37 +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
- };
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- pathSet
37
- });
@@ -1,2 +0,0 @@
1
- import pluralize from "pluralize";
2
- export { pluralize };
package/src/pluralize.js DELETED
@@ -1,37 +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"));
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- pluralize
37
- });
@@ -1 +0,0 @@
1
- export declare const randomPick: <T = any>(arr: T[] | readonly T[]) => T;
package/src/randomPick.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 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)];
24
- // Annotate the CommonJS export names for ESM import in node:
25
- 0 && (module.exports = {
26
- randomPick
27
- });
@@ -1 +0,0 @@
1
- export declare const randomPicks: <T>(arr: T[] | readonly T[], count?: number, allowDuplicate?: boolean) => T[];
@@ -1,39 +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
- };
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- randomPicks
39
- });
package/src/sleep.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const sleep: (ms: number) => Promise<unknown>;