tuple-ts 0.4.3 → 0.4.4
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 +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ Equal values are **interned to the same object**.
|
|
|
22
22
|
|
|
23
23
|
That makes tuples and structs immutable, naturally usable as composite `Map` keys and `Set` values, and particularly pleasant to use in functional TypeScript.
|
|
24
24
|
|
|
25
|
+
**Zero dependencies · ~730 B minified · ~410 B minified + gzipped**
|
|
26
|
+
|
|
25
27
|
## Install
|
|
26
28
|
|
|
27
29
|
```bash
|
|
@@ -64,9 +66,9 @@ Tuples are ordinary frozen arrays, so there is no special API to learn:
|
|
|
64
66
|
```ts
|
|
65
67
|
const t = tuple("hello", 42, true);
|
|
66
68
|
|
|
67
|
-
t.length;
|
|
68
|
-
t[0];
|
|
69
|
-
[...t];
|
|
69
|
+
t.length; // 3
|
|
70
|
+
t[0]; // "hello"
|
|
71
|
+
[...t]; // ["hello", 42, true]
|
|
70
72
|
Object.isFrozen(t); // true
|
|
71
73
|
```
|
|
72
74
|
|