@williamthorsen/toolbelt.arrays 5.0.0 → 5.0.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/CHANGELOG.md +8 -0
- package/README.md +1 -19
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 5.0.1 — 2026-08-16
|
|
6
|
+
|
|
7
|
+
### Tests
|
|
8
|
+
|
|
9
|
+
- Drop expect-type in favor of expectTypeOf (#175)
|
|
10
|
+
|
|
11
|
+
Replaces all imports of `expectTypeOf` from `expect-type` with the same import from `vitest`. Previously there had been imports from both libraries. `expect-type` is removed as a dependency.
|
|
12
|
+
|
|
5
13
|
## 5.0.0 — 2026-08-15
|
|
6
14
|
|
|
7
15
|
### Features
|
package/README.md
CHANGED
|
@@ -2,25 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Array utilities.
|
|
4
4
|
|
|
5
|
-
<!-- section:release-notes -->
|
|
6
|
-
## Release notes — v5.0.0 (2026-08-15)
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
- 🚨 **Breaking:** Fix unsound narrowing in `getAtIndexOrThrow` and rename it to `getItemAtIndexOrThrow` (#152)
|
|
11
|
-
|
|
12
|
-
Fixes an issue where `getAtIndexOrThrow` could falsely treat an `undefined` return value as satisfying a return type that excluded `undefined`. The function now throws a `RangeError` if the array holds no item at the index and a `TypeError` if the index is not a safe integer. `undefined` is a valid return value if the input array's type allows `undefined` elements. The function is renamed `getItemAtIndexOrThrow`.
|
|
13
|
-
|
|
14
|
-
Separately, `findOrThrow` now decides a match by its predicate rather than by the value it found, so an element is not treated as not found merely because it is falsy. Its return type is now `T` rather than `NonNullable<T>`.
|
|
15
|
-
|
|
16
|
-
Migration: Consumers of `@williamthorsen/toolbelt.arrays/candidate` import `getItemAtIndexOrThrow` in place of `getAtIndexOrThrow`.
|
|
17
|
-
|
|
18
|
-
- 🚨 **Breaking:** Rename `findOrThrow` to `findItemOrThrow` and document it (#153)
|
|
19
|
-
|
|
20
|
-
Renames `findOrThrow` to `findItemOrThrow` in `@williamthorsen/toolbelt.arrays` for consistency with repo naming conventions.
|
|
21
|
-
|
|
22
|
-
Migration: Consumers import `findItemOrThrow` from `@williamthorsen/toolbelt.arrays/candidate`. The signature and behavior are unchanged.
|
|
23
|
-
<!-- /section:release-notes -->
|
|
5
|
+
<!-- section:release-notes --><!-- /section:release-notes -->
|
|
24
6
|
|
|
25
7
|
## Installation
|
|
26
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@williamthorsen/toolbelt.arrays",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Array utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"CHANGELOG.md"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@williamthorsen/toolbelt.
|
|
48
|
-
"@williamthorsen/toolbelt.
|
|
47
|
+
"@williamthorsen/toolbelt.guards": "3.1.11",
|
|
48
|
+
"@williamthorsen/toolbelt.numbers": "6.0.1"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=24.0.0"
|