js-utils-kit 0.2.3 → 0.3.1
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/README.md +49 -16
- package/dist/array/index.cjs +1 -0
- package/dist/array/index.d.ts +21 -0
- package/dist/array/index.js +1 -0
- package/dist/char/index.d.ts +4 -4
- package/dist/cli/index.js +8 -8
- package/dist/file/index.cjs +8 -8
- package/dist/file/index.js +8 -8
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +37 -7
- package/dist/index.js +1 -1
- package/dist/object/index.cjs +1 -1
- package/dist/object/index.d.ts +46 -3
- package/dist/object/index.js +1 -1
- package/dist/string/index.cjs +1 -1
- package/dist/string/index.d.ts +279 -3
- package/dist/string/index.js +1 -1
- package/dist/validate-BKQ-HFTd.js +1 -0
- package/dist/validate-D9J7otjc.js +1 -0
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/TenEplaysOfficial/js-utils-kit)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/TenEplaysOfficial/js-utils-kit)
|
|
6
|
+
[](https://www.npmjs.com/package/js-utils-kit)
|
|
7
|
+
[](https://jsr.io/@tene/js-utils-kit)
|
|
8
|
+
[](https://jsr.io/@tene/js-utils-kit)
|
|
9
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit/blob/main/LICENSE)
|
|
10
|
+
[](https://bundlephobia.com/package/js-utils-kit)
|
|
11
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit/stargazers)
|
|
12
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit/issues)
|
|
13
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit/pulls)
|
|
14
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit/commits)
|
|
15
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit/discussions)
|
|
16
|
+
[](https://www.npmjs.com/package/js-utils-kit)
|
|
17
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit)
|
|
18
|
+
[](https://github.com/TenEplaysOfficial/js-utils-kit)
|
|
19
|
+
[](https://github.com/sponsors/TenEplaysOfficial)
|
|
20
|
+
[](https://x.com/teneplays)
|
|
19
21
|
|
|
20
22
|
</div>
|
|
21
23
|
|
|
@@ -28,9 +30,26 @@ This package includes utilities designed for both browser and Node.js environmen
|
|
|
28
30
|
## Installation
|
|
29
31
|
|
|
30
32
|
```sh
|
|
31
|
-
|
|
32
|
-
# or
|
|
33
|
+
# via npm
|
|
33
34
|
npm install js-utils-kit
|
|
35
|
+
|
|
36
|
+
# via yarn
|
|
37
|
+
yarn add js-utils-kit
|
|
38
|
+
|
|
39
|
+
# via pnpm
|
|
40
|
+
pnpm add js-utils-kit
|
|
41
|
+
|
|
42
|
+
# via bun
|
|
43
|
+
bun add js-utils-kit
|
|
44
|
+
|
|
45
|
+
# via Deno (using npm)
|
|
46
|
+
deno add npm:js-utils-kit
|
|
47
|
+
|
|
48
|
+
# via Deno (using JSR)
|
|
49
|
+
deno add jsr:@tene/js-utils-kit
|
|
50
|
+
|
|
51
|
+
# via JSR
|
|
52
|
+
npx jsr add @tene/js-utils-kit
|
|
34
53
|
```
|
|
35
54
|
|
|
36
55
|
## Usage
|
|
@@ -77,6 +96,20 @@ console.log(string.capitalize('js-utils-kit')); // 'Js-utils-kit'
|
|
|
77
96
|
console.log(env.isDev()); // true/false
|
|
78
97
|
```
|
|
79
98
|
|
|
99
|
+
### Using JSR or Deno
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
import { number, string, env } from '@tene/js-utils-kit';
|
|
103
|
+
// or
|
|
104
|
+
import { number, string, env } from 'jsr:@tene/js-utils-kit';
|
|
105
|
+
// or
|
|
106
|
+
import number from '@tene/js-utils-kit/number';
|
|
107
|
+
import string from '@tene/js-utils-kit/string';
|
|
108
|
+
import array from '@tene/js-utils-kit/array';
|
|
109
|
+
import object from '@tene/js-utils-kit/object';
|
|
110
|
+
import env from '@tene/js-utils-kit/env';
|
|
111
|
+
```
|
|
112
|
+
|
|
80
113
|
### CommonJS Usage
|
|
81
114
|
|
|
82
115
|
```js
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../validate-BKQ-HFTd.js"),e={isArray:r.isArray};exports.isArray=r.isArray,exports.default=e;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a value is a defined array.
|
|
3
|
+
* @param value - The value to check.
|
|
4
|
+
* @returns True if the value is a defined array, false otherwise.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* console.log(isArray([1, 2, 3])); // true
|
|
8
|
+
* console.log(isArray([])); // true
|
|
9
|
+
* console.log(isArray({})); // false
|
|
10
|
+
* console.log(isArray(null)); // false
|
|
11
|
+
* console.log(isArray(undefined)); // false
|
|
12
|
+
* console.log(isArray("hello")); // false
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare function isArray<T>(value: T): boolean;
|
|
16
|
+
|
|
17
|
+
declare const _default: {
|
|
18
|
+
isArray: typeof isArray;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { _default as default, isArray };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as a}from"../validate-D9J7otjc.js";var r={isArray:a};export{r as default,a as isArray};
|
package/dist/char/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generates an array of lowercase ASCII alphabet characters (a–z).
|
|
3
3
|
*
|
|
4
|
-
* @returns
|
|
4
|
+
* @returns An array containing 'a' to 'z'.
|
|
5
5
|
* @example
|
|
6
6
|
* lowercase(); // ['a', 'b', ..., 'z']
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ declare const lowercase: () => string[];
|
|
|
9
9
|
/**
|
|
10
10
|
* Generates an array of uppercase ASCII alphabet characters (A–Z).
|
|
11
11
|
*
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns An array containing 'A' to 'Z'.
|
|
13
13
|
* @example
|
|
14
14
|
* uppercase(); // ['A', 'B', ..., 'Z']
|
|
15
15
|
*/
|
|
@@ -17,7 +17,7 @@ declare const uppercase: () => string[];
|
|
|
17
17
|
/**
|
|
18
18
|
* Generates an array of ASCII digit characters (0–9).
|
|
19
19
|
*
|
|
20
|
-
* @returns
|
|
20
|
+
* @returns An array containing '0' to '9'.
|
|
21
21
|
* @example
|
|
22
22
|
* digits(); // ['0', '1', ..., '9']
|
|
23
23
|
*/
|
|
@@ -25,7 +25,7 @@ declare const digits: () => string[];
|
|
|
25
25
|
/**
|
|
26
26
|
* Combines lowercase, uppercase, and digit characters into a single array.
|
|
27
27
|
*
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns An array containing 'a'–'z', 'A'–'Z', and '0'–'9'.
|
|
29
29
|
* @example
|
|
30
30
|
* all(); // ['a', ..., 'z', 'A', ..., 'Z', '0', ..., '9']
|
|
31
31
|
*/
|