js-utils-kit 0.0.0 → 0.2.0
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/LICENSE +20 -20
- package/README.md +153 -3
- package/dist/char/index.cjs +1 -0
- package/dist/char/index.d.ts +41 -0
- package/dist/char/index.js +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/env/index.cjs +1 -0
- package/dist/env/index.d.ts +128 -0
- package/dist/env/index.js +1 -0
- package/dist/file/index.cjs +49 -0
- package/dist/file/index.d.ts +75 -0
- package/dist/file/index.js +49 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/number/index.cjs +1 -0
- package/dist/number/index.d.ts +74 -0
- package/dist/number/index.js +1 -0
- package/dist/object/index.cjs +1 -0
- package/dist/object/index.d.ts +46 -0
- package/dist/object/index.js +1 -0
- package/dist/string/index.cjs +1 -0
- package/dist/string/index.d.ts +137 -0
- package/dist/string/index.js +1 -0
- package/package.json +110 -72
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./char/index.cjs"),r=require("./env/index.cjs"),i=require("./file/index.cjs"),u=require("./number/index.cjs"),s=require("./object/index.cjs"),t=require("./string/index.cjs");require("fs"),require("path"),require("constants"),require("stream"),require("util"),require("assert"),require("buffer"),require("node:url"),require("node:path"),require("node:fs"),require("node:fs/promises"),require("node:events"),require("node:stream"),require("node:string_decoder"),require("zlib"),exports.char=e.default,exports.env=r.default,exports.file=i.default,exports.number=u.default,exports.object=s.default,exports.string=t.default;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as char } from './char/index.js';
|
|
2
|
+
export { default as env } from './env/index.js';
|
|
3
|
+
export { default as file } from './file/index.js';
|
|
4
|
+
export { default as number } from './number/index.js';
|
|
5
|
+
export { default as object } from './object/index.js';
|
|
6
|
+
export { default as string } from './string/index.js';
|
|
7
|
+
import 'archiver';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as char}from"./char/index.js";export{default as env}from"./env/index.js";export{default as file}from"./file/index.js";export{default as number}from"./number/index.js";export{default as object}from"./object/index.js";export{default as string}from"./string/index.js";import"fs";import"path";import"constants";import"stream";import"util";import"assert";import"buffer";import"node:url";import"node:path";import"node:fs";import"node:fs/promises";import"node:events";import"node:stream";import"node:string_decoder";import"zlib";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(t,r,n){return Math.min(Math.max(t,r),n)}function r(t){return t%2==0}function n(t){return t%2!=0}function o(t,r){return Math.floor(Math.random()*(r-t+1))+t}function e(t,r){return Math.random()*(r-t)+t}Object.defineProperty(exports,"__esModule",{value:!0});var a={clamp:t,isEven:r,isOdd:n,randomInt:o,randomFloat:e};exports.clamp=t,exports.default=a,exports.isEven=r,exports.isOdd=n,exports.randomFloat=e,exports.randomInt=o;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clamps a number between a minimum and maximum value.
|
|
3
|
+
*
|
|
4
|
+
* Ensures that the returned number is not less than `min` and not more than `max`.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The number to clamp.
|
|
7
|
+
* @param min - The minimum allowed value.
|
|
8
|
+
* @param max - The maximum allowed value.
|
|
9
|
+
* @returns The clamped number.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* clamp(5, 1, 10); // 5
|
|
13
|
+
* clamp(0, 1, 10); // 1
|
|
14
|
+
* clamp(15, 1, 10); // 10
|
|
15
|
+
*/
|
|
16
|
+
declare function clamp(value: number, min: number, max: number): number;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a number is even.
|
|
20
|
+
*
|
|
21
|
+
* @param value - The number to check.
|
|
22
|
+
* @returns True if the number is even, false otherwise.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* isEven(4); // true
|
|
26
|
+
* isEven(3); // false
|
|
27
|
+
*/
|
|
28
|
+
declare function isEven(value: number): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Checks if a number is odd.
|
|
31
|
+
*
|
|
32
|
+
* @param value - The number to check.
|
|
33
|
+
* @returns True if the number is odd, false otherwise.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* isOdd(3); // true
|
|
37
|
+
* isOdd(4); // false
|
|
38
|
+
*/
|
|
39
|
+
declare function isOdd(value: number): boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns a random integer between `min` and `max`, inclusive.
|
|
43
|
+
*
|
|
44
|
+
* @param min - Minimum value (inclusive).
|
|
45
|
+
* @param max - Maximum value (inclusive).
|
|
46
|
+
* @returns A random integer between min and max.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* randomInt(1, 5); // 3
|
|
50
|
+
* randomInt(10, 20); // 17
|
|
51
|
+
*/
|
|
52
|
+
declare function randomInt(min: number, max: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a random floating-point number between `min` and `max`.
|
|
55
|
+
*
|
|
56
|
+
* @param min - Minimum value (inclusive).
|
|
57
|
+
* @param max - Maximum value (exclusive).
|
|
58
|
+
* @returns A random float between min and max.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* randomFloat(0, 1); // 0.624...
|
|
62
|
+
* randomFloat(1.5, 5.2); // 3.1415...
|
|
63
|
+
*/
|
|
64
|
+
declare function randomFloat(min: number, max: number): number;
|
|
65
|
+
|
|
66
|
+
declare const _default: {
|
|
67
|
+
clamp: typeof clamp;
|
|
68
|
+
isEven: typeof isEven;
|
|
69
|
+
isOdd: typeof isOdd;
|
|
70
|
+
randomInt: typeof randomInt;
|
|
71
|
+
randomFloat: typeof randomFloat;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { clamp, _default as default, isEven, isOdd, randomFloat, randomInt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n,t,r){return Math.min(Math.max(n,t),r)}function t(n){return n%2==0}function r(n){return n%2!=0}function a(n,t){return Math.floor(Math.random()*(t-n+1))+n}function o(n,t){return Math.random()*(t-n)+n}var u={clamp:n,isEven:t,isOdd:r,randomInt:a,randomFloat:o};export{n as clamp,u as default,t as isEven,r as isOdd,o as randomFloat,a as randomInt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(e=!1,...t){const o=r=>"object"==typeof r&&null!==r&&!Array.isArray(r);return t.reduce((t,s)=>{for(const n in s){const a=s[n],u=t[n];Array.isArray(a)?t[n]=e&&Array.isArray(u)?[...u,...a]:[...a]:o(a)?t[n]=r(e,o(u)?u:{},a):t[n]=a}return t},{})}Object.defineProperty(exports,"__esModule",{value:!0});var e={mergeObj:r};exports.default=e,exports.mergeObj=r;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deeply merges multiple source objects into one.
|
|
3
|
+
*
|
|
4
|
+
* - Object properties are merged recursively.
|
|
5
|
+
* - If a key exists in multiple objects:
|
|
6
|
+
* - If the value is a plain object, it is deeply merged.
|
|
7
|
+
* - If the value is an array:
|
|
8
|
+
* - If `appendArray` is `true`, arrays are concatenated.
|
|
9
|
+
* - If `appendArray` is `false` (default), later arrays replace earlier ones.
|
|
10
|
+
* - Primitive values (string, number, boolean, etc.) are overwritten by later sources.
|
|
11
|
+
*
|
|
12
|
+
* - Objects passed later in the list of sources have **higher priority**.
|
|
13
|
+
* For example, values in the last object will override previous ones.
|
|
14
|
+
* - If you want to give **priority to a specific object**, **pass it last**.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const defaultConfig = { env: "dev", features: ["a"], flags: { debug: true } };
|
|
19
|
+
* const userConfig = { env: "prod", features: ["b"], flags: { beta: true } };
|
|
20
|
+
*
|
|
21
|
+
* const result = mergeObj(false, defaultConfig, userConfig);
|
|
22
|
+
* // {
|
|
23
|
+
* // env: "prod",
|
|
24
|
+
* // features: ["b"], // replaced, not merged
|
|
25
|
+
* // flags: { debug: true, beta: true }
|
|
26
|
+
* // }
|
|
27
|
+
*
|
|
28
|
+
* const result2 = mergeObj(true, defaultConfig, userConfig);
|
|
29
|
+
* // {
|
|
30
|
+
* // env: "prod",
|
|
31
|
+
* // features: ["a", "b"], // arrays merged
|
|
32
|
+
* // flags: { debug: true, beta: true }
|
|
33
|
+
* // }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param appendArray - If `true`, arrays are concatenated. If `false` (default), arrays are replaced.
|
|
37
|
+
* @param sources - One or more objects to deeply merge.
|
|
38
|
+
* @returns A new object containing deeply merged keys and values.
|
|
39
|
+
*/
|
|
40
|
+
declare function mergeObj(appendArray?: boolean, ...sources: Record<string, unknown>[]): Record<string, unknown>;
|
|
41
|
+
|
|
42
|
+
declare const _default: {
|
|
43
|
+
mergeObj: typeof mergeObj;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { _default as default, mergeObj };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(e=!1,...t){const a=r=>"object"==typeof r&&null!==r&&!Array.isArray(r);return t.reduce((t,n)=>{for(const o in n){const s=n[o],y=t[o];Array.isArray(s)?t[o]=e&&Array.isArray(y)?[...y,...s]:[...s]:a(s)?t[o]=r(e,a(y)?y:{},s):t[o]=s}return t},{})}var e={mergeObj:r};export{e as default,r as mergeObj};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(t){return null!=t&&"string"==typeof t}function r(r,e=!0){return!!t(r)&&(e?r.trim().length>0:r.length>0)}function e(t){try{return new URL(t),!0}catch{return!1}}function i(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function n(t){return/^[a-zA-Z]+$/.test(t)}function s(t){return!isNaN(Number(t))&&!isNaN(parseFloat(t))}Object.defineProperty(exports,"__esModule",{value:!0});var u={isString:t,isNonEmptyString:r,isURL:e,isEmail:i,isAlphabetic:n,isNumericString:s};exports.default=u,exports.isAlphabetic=n,exports.isEmail=i,exports.isNonEmptyString=r,exports.isNumericString=s,exports.isString=t,exports.isURL=e;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether the provided value is a string.
|
|
3
|
+
*
|
|
4
|
+
* This function returns `true` if the input is a non-null, non-undefined
|
|
5
|
+
* primitive string. It acts as a type guard, so TypeScript will narrow
|
|
6
|
+
* the type to `string` when used in conditionals.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type of the input value.
|
|
9
|
+
* @param value - The value to be checked.
|
|
10
|
+
* @returns - Whether the value is a string (`true`) or not (`false`).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* isString("hello"); // true
|
|
15
|
+
* isString(123); // false
|
|
16
|
+
* isString(null); // false
|
|
17
|
+
* isString(undefined); // false
|
|
18
|
+
*
|
|
19
|
+
* const value: unknown = "test";
|
|
20
|
+
* if (isString(value)) {
|
|
21
|
+
* console.log(value.toUpperCase());
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function isString<T>(value: T): value is T & string;
|
|
26
|
+
/**
|
|
27
|
+
* Determines whether the given value is a non-empty string.
|
|
28
|
+
*
|
|
29
|
+
* This function first checks if the input is a string using {@link isString}.
|
|
30
|
+
* If it is not a string, the function returns `false`.
|
|
31
|
+
* If it is a string, it then checks whether the string contains any non-empty content.
|
|
32
|
+
*
|
|
33
|
+
* By default, the function trims the string before checking its length,
|
|
34
|
+
* which means strings containing only whitespace (e.g., `" "`) will be considered empty.
|
|
35
|
+
* This behavior can be controlled using the `trim` parameter.
|
|
36
|
+
*
|
|
37
|
+
* @template T - The type of the value being checked.
|
|
38
|
+
*
|
|
39
|
+
* @param value - The value to validate as a non-empty string.
|
|
40
|
+
* @param trim - Whether to trim whitespace from the string before checking its length.
|
|
41
|
+
* Defaults to `true`.
|
|
42
|
+
*
|
|
43
|
+
* @returns - A boolean indicating whether the input is a non-empty string.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* isNonEmptyString('hello'); // true
|
|
47
|
+
* isNonEmptyString(' '); // false (trim is true by default)
|
|
48
|
+
* isNonEmptyString(' ', false); // true (whitespace is counted)
|
|
49
|
+
* isNonEmptyString(123); // false
|
|
50
|
+
* isNonEmptyString(null); // false
|
|
51
|
+
*/
|
|
52
|
+
declare function isNonEmptyString<T>(value: T, trim?: boolean): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Checks whether a given string is a valid absolute URL.
|
|
55
|
+
*
|
|
56
|
+
* This function uses the native `URL` constructor to determine if the input is a valid,
|
|
57
|
+
* absolute URL with a supported protocol (e.g., `http`, `https`, `ftp`, etc.).
|
|
58
|
+
*
|
|
59
|
+
* @param value - The string to validate as a URL.
|
|
60
|
+
* @returns - `true` if the string is a valid absolute URL; otherwise, `false`.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* isURL('https://example.com'); // true
|
|
64
|
+
* isURL('ftp://files.example.com'); // true
|
|
65
|
+
* isURL('invalid-url'); // false
|
|
66
|
+
* isURL('/relative/path'); // false
|
|
67
|
+
*/
|
|
68
|
+
declare function isURL(value: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Checks whether a given string is a valid email address.
|
|
71
|
+
*
|
|
72
|
+
* This function uses a practical regular expression to validate email addresses,
|
|
73
|
+
* allowing most common formats while ignoring edge cases defined by full RFC 5322.
|
|
74
|
+
* It requires the presence of an `@` symbol and at least one `.` after it.
|
|
75
|
+
*
|
|
76
|
+
* @param value - The string to validate as an email address.
|
|
77
|
+
* @returns - `true` if the string is a valid email; otherwise, `false`.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* isEmail('user@example.com'); // true
|
|
81
|
+
* isEmail('first.last@college.university.in'); // true
|
|
82
|
+
* isEmail('invalid-email'); // false
|
|
83
|
+
* isEmail('name@domain'); // false
|
|
84
|
+
*/
|
|
85
|
+
declare function isEmail(value: string): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Checks if a string contains only alphabetic characters (A–Z, a–z).
|
|
88
|
+
*
|
|
89
|
+
* @param value - The string to check.
|
|
90
|
+
* @returns - `true` if the string contains only letters; otherwise, `false`.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* isAlphabetic("Hello"); // true
|
|
94
|
+
* isAlphabetic("world123"); // false
|
|
95
|
+
* isAlphabetic("Test!"); // false
|
|
96
|
+
*/
|
|
97
|
+
declare function isAlphabetic(value: string): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Checks whether a given string represents a valid numeric value.
|
|
100
|
+
*
|
|
101
|
+
* This function attempts to convert the input string to a number using
|
|
102
|
+
* both `Number()` and `parseFloat()`. It returns `true` only if both
|
|
103
|
+
* conversions do not result in `NaN`, ensuring that the input is
|
|
104
|
+
* a fully numeric string.
|
|
105
|
+
*
|
|
106
|
+
* Accepts integers, decimals, scientific notation (e.g. "1e5"), and
|
|
107
|
+
* ignores surrounding whitespace. Does not allow trailing or embedded characters
|
|
108
|
+
* like "123abc" or "abc123".
|
|
109
|
+
*
|
|
110
|
+
* @param value - The string to validate.
|
|
111
|
+
* @returns - `true` if the string represents a valid number; otherwise, `false`.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* isNumericString("42"); // true
|
|
115
|
+
* isNumericString("-3.14"); // true
|
|
116
|
+
* isNumericString("1e5"); // true
|
|
117
|
+
* isNumericString(" 123 "); // true
|
|
118
|
+
* isNumericString("123abc"); // false
|
|
119
|
+
* isNumericString("abc123"); // false
|
|
120
|
+
*
|
|
121
|
+
* See also:
|
|
122
|
+
* - {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number Number()}
|
|
123
|
+
* - {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat parseFloat()}
|
|
124
|
+
* - {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN isNaN()}
|
|
125
|
+
*/
|
|
126
|
+
declare function isNumericString(value: string): boolean;
|
|
127
|
+
|
|
128
|
+
declare const _default: {
|
|
129
|
+
isString: typeof isString;
|
|
130
|
+
isNonEmptyString: typeof isNonEmptyString;
|
|
131
|
+
isURL: typeof isURL;
|
|
132
|
+
isEmail: typeof isEmail;
|
|
133
|
+
isAlphabetic: typeof isAlphabetic;
|
|
134
|
+
isNumericString: typeof isNumericString;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export { _default as default, isAlphabetic, isEmail, isNonEmptyString, isNumericString, isString, isURL };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return null!=t&&"string"==typeof t}function n(n,r=!0){return!!t(n)&&(r?n.trim().length>0:n.length>0)}function r(t){try{return new URL(t),!0}catch{return!1}}function i(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function e(t){return/^[a-zA-Z]+$/.test(t)}function u(t){return!isNaN(Number(t))&&!isNaN(parseFloat(t))}var s={isString:t,isNonEmptyString:n,isURL:r,isEmail:i,isAlphabetic:e,isNumericString:u};export{s as default,e as isAlphabetic,i as isEmail,n as isNonEmptyString,u as isNumericString,t as isString,r as isURL};
|
package/package.json
CHANGED
|
@@ -1,72 +1,110 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "js-utils-kit",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "js-utils-kit",
|
|
3
|
+
"displayName": "JS Utils Kit",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "Essential JavaScript helpers",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"private": false,
|
|
8
|
+
"repository": "https://github.com/TenEplaysOfficial/js-utils-kit",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/TenEplaysOfficial/js-utils-kit/issues"
|
|
11
|
+
},
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Sriman",
|
|
14
|
+
"email": "136729116+TenEplaysOfficial@users.noreply.github.com",
|
|
15
|
+
"url": "https://tene.vercel.app"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"javascript",
|
|
19
|
+
"utils",
|
|
20
|
+
"helpers",
|
|
21
|
+
"toolkit",
|
|
22
|
+
"typescript",
|
|
23
|
+
"js",
|
|
24
|
+
"utility",
|
|
25
|
+
"functions",
|
|
26
|
+
"modules",
|
|
27
|
+
"typed",
|
|
28
|
+
"common",
|
|
29
|
+
"cli",
|
|
30
|
+
"merge",
|
|
31
|
+
"random",
|
|
32
|
+
"string",
|
|
33
|
+
"array",
|
|
34
|
+
"object",
|
|
35
|
+
"number",
|
|
36
|
+
"date",
|
|
37
|
+
"type-check"
|
|
38
|
+
],
|
|
39
|
+
"type": "module",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist/**/*"
|
|
42
|
+
],
|
|
43
|
+
"bin": {
|
|
44
|
+
"js-utils-kit": "dist/cli/index.js"
|
|
45
|
+
},
|
|
46
|
+
"main": "dist/index.cjs",
|
|
47
|
+
"module": "dist/index.js",
|
|
48
|
+
"types": "dist/index.d.ts",
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"import": "./dist/index.js",
|
|
52
|
+
"require": "./dist/index.cjs",
|
|
53
|
+
"types": "./dist/index.d.ts"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"lint-staged": {
|
|
57
|
+
"*.{js,mjs,ts,json,md,yml}": "yarn format"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"test": "jest",
|
|
61
|
+
"prebuild": "yarn gen:indexes",
|
|
62
|
+
"build": "rollup -c",
|
|
63
|
+
"postbuild": "yarn docs",
|
|
64
|
+
"release": "release-it",
|
|
65
|
+
"watch": "rollup -c --watch",
|
|
66
|
+
"lint": "eslint .",
|
|
67
|
+
"lint:fix": "npx eslint . --fix",
|
|
68
|
+
"format": "prettier --write",
|
|
69
|
+
"format:check": "prettier --check .",
|
|
70
|
+
"prepare": "husky",
|
|
71
|
+
"docs": "typedoc",
|
|
72
|
+
"gen:exports": "node scripts/gen-exports.js",
|
|
73
|
+
"gen:indexes": "node scripts/gen-indexes.js"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@eslint/js": "^9.29.0",
|
|
77
|
+
"@eslint/json": "^0.12.0",
|
|
78
|
+
"@eslint/markdown": "^6.6.0",
|
|
79
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
80
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
81
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
82
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
83
|
+
"@rollup/plugin-typescript": "^12.1.3",
|
|
84
|
+
"@types/archiver": "^6.0.3",
|
|
85
|
+
"@types/jest": "^30.0.0",
|
|
86
|
+
"@types/node": "^24.0.4",
|
|
87
|
+
"archiver": "^7.0.1",
|
|
88
|
+
"eslint": "^9.29.0",
|
|
89
|
+
"globals": "^16.2.0",
|
|
90
|
+
"husky": "^9.1.7",
|
|
91
|
+
"jest": "^30.0.3",
|
|
92
|
+
"jest-environment-node": "^30.0.2",
|
|
93
|
+
"lint-staged": "^16.1.2",
|
|
94
|
+
"prettier": "^3.6.0",
|
|
95
|
+
"release-it": "^19.0.3",
|
|
96
|
+
"rollup": "^4.44.0",
|
|
97
|
+
"rollup-plugin-delete": "^3.0.1",
|
|
98
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
99
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
100
|
+
"ts-jest": "^29.4.0",
|
|
101
|
+
"tslib": "^2.8.1",
|
|
102
|
+
"typedoc": "^0.28.5",
|
|
103
|
+
"typescript": "^5.8.3",
|
|
104
|
+
"typescript-eslint": "^8.35.0"
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"commander": "^14.0.0",
|
|
108
|
+
"ora": "^8.2.0"
|
|
109
|
+
}
|
|
110
|
+
}
|