@theholocron/array-utils 1.0.0 → 1.0.2
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 +21 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@theholocron/array-utils`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Array validation utilities.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
pnpm add @theholocron/array-utils
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { isValid } from "@theholocron/array-utils";
|
|
15
|
+
|
|
16
|
+
isValid(["a", "b"]); // true — non-empty array
|
|
17
|
+
isValid([]); // false — empty array
|
|
18
|
+
isValid(null); // false — null
|
|
19
|
+
isValid(undefined); // false — undefined
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### `isValid(item)`
|
|
23
|
+
|
|
24
|
+
Returns `true` if the value is a non-null, non-undefined, non-empty array. Returns `false` for `null`, `undefined`, or `[]`.
|
|
25
|
+
|
|
26
|
+
## Documentation
|
|
27
|
+
|
|
28
|
+
Check out [The Holocron Archive](https://docs.theholocron.dev/projects/utils/) for more information.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/array-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Convert or manipulate arrays.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/utils/tree/main/packages/utils-array#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/utils/issues",
|