ts-data-forge 1.5.2 → 2.0.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/README.md +13 -1
- package/dist/array/array-utils.d.mts +661 -166
- package/dist/array/array-utils.d.mts.map +1 -1
- package/dist/array/array-utils.mjs +719 -79
- package/dist/array/array-utils.mjs.map +1 -1
- package/dist/array/index.d.mts +0 -1
- package/dist/array/index.d.mts.map +1 -1
- package/dist/array/index.mjs +0 -1
- package/dist/array/index.mjs.map +1 -1
- package/dist/collections/queue.mjs +0 -1
- package/dist/collections/queue.mjs.map +1 -1
- package/dist/collections/stack.mjs +4 -5
- package/dist/collections/stack.mjs.map +1 -1
- package/dist/globals.d.mts +10 -9
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/json/json.mjs +0 -1
- package/dist/json/json.mjs.map +1 -1
- package/dist/number/num.d.mts +1 -1
- package/package.json +2 -2
- package/src/array/array-utils-modification.test.mts +93 -67
- package/src/array/array-utils-overload-type-error.test.mts +2 -2
- package/src/array/array-utils-reducing-value.test.mts +31 -37
- package/src/array/array-utils-slice-clamped.test.mts +94 -70
- package/src/array/array-utils-transformation.test.mts +557 -10
- package/src/array/array-utils.mts +1457 -516
- package/src/array/index.mts +0 -1
- package/src/collections/queue.mts +2 -2
- package/src/collections/stack.mts +8 -8
- package/src/globals.d.mts +10 -9
- package/src/number/num.mts +1 -1
- package/dist/array/tuple-utils.d.mts +0 -407
- package/dist/array/tuple-utils.d.mts.map +0 -1
- package/dist/array/tuple-utils.mjs +0 -345
- package/dist/array/tuple-utils.mjs.map +0 -1
- package/src/array/tuple-utils.mts +0 -498
- package/src/array/tuple-utils.test.mts +0 -518
package/README.md
CHANGED
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
**ts-data-forge** is a TypeScript utility library that provides type-safe functional programming utilities with zero runtime dependencies. It aims to enhance development robustness, maintainability, and correctness by leveraging TypeScript's powerful type system.
|
|
9
9
|
|
|
10
|
+
## Perfect Companion to ts-type-forge
|
|
11
|
+
|
|
12
|
+
**ts-data-forge** is designed as the ideal runtime companion to [**ts-type-forge**](https://github.com/noshiro-pf/ts-type-forge), a powerful type utility library. While ts-type-forge provides compile-time type utilities for advanced TypeScript type manipulation, ts-data-forge complements it with runtime utilities that maintain the same level of type safety.
|
|
13
|
+
|
|
14
|
+
Together, they form a complete TypeScript development toolkit:
|
|
15
|
+
|
|
16
|
+
- **ts-type-forge**: Compile-time type utilities (type manipulation, type inference, advanced type patterns)
|
|
17
|
+
- **ts-data-forge**: Runtime utilities with strong type safety (type guards, branded types, functional programming utilities)
|
|
18
|
+
|
|
19
|
+
This synergy enables you to build fully type-safe applications from compile-time to runtime, ensuring type correctness throughout your entire codebase.
|
|
20
|
+
|
|
10
21
|
## Features
|
|
11
22
|
|
|
12
23
|
This library offers a range of utilities, including:
|
|
@@ -532,7 +543,8 @@ assert.deepStrictEqual(updatedState.items, ['newItem1', 'newItem2']);
|
|
|
532
543
|
|
|
533
544
|
**Important Notes:**
|
|
534
545
|
|
|
535
|
-
- This library **only supports ESM (ES Modules)
|
|
546
|
+
- This library **only supports ESM (ES Modules)** and is designed for native ESM environments. CommonJS is not supported.
|
|
547
|
+
- The library uses `.mts` file extensions and proper ESM exports, making it compatible with modern Node.js ESM resolution and bundlers that support native ESM.
|
|
536
548
|
- This library uses advanced TypeScript features, including branded types for enhanced type safety. Some functions require specific branded types as parameters (such as `Uint32` in `newArray`). The examples above use the small literal numeric values specifically allowed in each function for brevity, but in actual use you should use the provided type conversion functions (such as `asUint32`) or cast to the appropriate branded type, for example `as Uint32`.
|
|
537
549
|
|
|
538
550
|
## Removing `expectType` in Production
|