@williamthorsen/toolbelt.arrays 3.3.1 → 3.3.5

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 CHANGED
@@ -1,98 +1,110 @@
1
- # @williamthorsen/toolbelt.arrays changelog
1
+ # Changelog
2
2
 
3
- ## 3.3.1
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [arrays-v3.3.5] - 2026-03-19
6
+
7
+ ### Formatting
8
+
9
+ - Fmt: Format changelogs
10
+
11
+ ## [strings-v3.1.1] - 2026-03-10
4
12
 
5
13
  ### Dependencies
6
14
 
7
- - Updated internal dependencies:
8
- - @williamthorsen/toolbelt.numbers@4.3.0
15
+ - #6 deps: Adapt to dependency upgrades and bump Node engine to >=24 (#8)
9
16
 
10
- ## 3.3.0
17
+ Upgrades all dependencies to their latest versions, bumps the Node.js engine requirement from >=18.17.0 to >=24.0.0 across all 13 workspace packages, and adapts source code to satisfy new lint rules introduced by the upgraded ESLint plugins. Also upgrades `@williamthorsen/eslint-config-typescript` from 5.12.1 to 5.12.2 to fix ESM import issues in the compiled output.
11
18
 
12
- ### Features
19
+ Commit details:
13
20
 
14
- - Added `getUniqueItems`
15
- - Renamed `getDuplicates` to `getDuplicateItems` for consistency with other function names
21
+ * root|deps: Upgrade all deps to latest version
16
22
 
17
- ## 3.2.0
23
+ * root|refactor: Fix lint
18
24
 
19
- ### Features
25
+ * root|deps: Upgrade all deps to latest minor version
20
26
 
21
- - Added `map` and `forEach` methods to `Range` class
22
- - Simplified `Range` class to accept two arguments instead of object
27
+ * root|deps: Allow unpatchable vulns in dev deps
23
28
 
24
- ## 3.1.0
29
+ * root|refactor: Adapt to dependency upgrades and bump Node engine to >=24
25
30
 
26
- ### Features
31
+ - Upgrade eslint-config-typescript to 5.12.2 (fixes ESM import issues, removes need for pnpm patch)
32
+ - Bump engines.node from >=18.17.0 to >=24.0.0 across all packages
33
+ - Update CI to Node 24.14.0 and pnpm 10.30.3
34
+ - Replace .sort() with .toSorted() to satisfy unicorn/no-array-sort
35
+ - Fix lint errors: remove useless default assignments, redundant type constituents, deprecated re-exports, and empty array args to Set constructor
27
36
 
28
- - Added a `Range` class to generate and iterate over a range of numbers.
37
+ * datetime|tests: Fix locale mismatch in Timestamp test
29
38
 
30
- ## 3.0.4
39
+ Pass the same 'en-US' locale to both the expected-value computation and
40
+ the method under test. Previously the test used the system default locale
41
+ for the expected value but explicit 'en-US' for the actual call, which
42
+ diverged under Node 24's updated Intl formatting.
31
43
 
32
- ### Dependencies
44
+ * root|refactor: Replace toThrow with toThrowError across all tests
33
45
 
34
- - Updated internal dependencies:
35
- - @williamthorsen/toolbelt.numbers@4.2.0
46
+ The vitest/no-alias-methods rule in strict-lint requires the canonical
47
+ toThrowError() name instead of the toThrow() alias.
36
48
 
37
- ## 3.0.3
49
+ * root|refactor: Fix remaining strict-lint errors
38
50
 
39
- ### Dependencies
51
+ - Use import() in vi.mock for vitest/prefer-import-in-mock
52
+ - Replace expect(typeof x).toBe() with expectTypeOf for vitest/prefer-expect-type-of
53
+ - Use String.raw for regex escapes for unicorn/prefer-string-raw
40
54
 
41
- - Updated internal dependencies:
42
- - @williamthorsen/toolbelt.numbers@4.1.0
55
+ * root|tooling: Use ws runner to fix recursive build command
43
56
 
44
- ## 3.0.2
57
+ The build script used `pnpm --recursive run build` but no workspace package defines a `build` script — they all use `ws build` through the workspace script runner. Aligns with all other recursive commands.
45
58
 
46
- ### Fixes
59
+ ### Features
60
+
61
+ - Arrays|feat: Range class
62
+ - Arrays|feat: Simplify Range API
63
+ - Arrays|feat: Add getUniqueItems
47
64
 
48
- - Fixed the issue that code relies on Node.js `assert` but could be used in a browser environment
65
+ ### Refactoring
49
66
 
50
- ## 3.0.1
67
+ - Arrays|refactor: Rename getDuplicates to getDuplicateItems
51
68
 
52
69
  ### Tooling
53
70
 
54
- - Renamed `publish` script to avoid recursion
71
+ - *|tooling: Change package registry from github to npmjs
55
72
 
56
- ## 3.0.0
73
+ ## [3.0.2] - 2025-05-22
57
74
 
58
- ### Breaking changes
75
+ ### Bug fixes
59
76
 
60
- - Migrated to staged distribution of library functions.
61
- For example, some functions have been moved to `/candidate` or `/draft`.
77
+ - Arrays|fix: Replace Node.js assert with library assert
62
78
 
63
- ### Features
79
+ ## [3.0.1] - 2025-05-20
64
80
 
65
- #### Stage 1: Proposed
66
-
67
- - Added:
68
- - `accumulateWeights`
69
-
70
- #### Stage 3: Candidate
71
-
72
- - Added:
73
- - `arraify`
74
- - `extractWeights`
75
- - `findOrThrow`
76
- - `getAtIndexOrThrow`
77
- - `getDuplicates`
78
- - `getWeightedIndex`
79
- - `includes`
80
- - `makeNullishCompare`
81
- - `makePickWeightedItemFromDistribution`
82
- - `nullishCompare`
83
- - `pickItem`
84
- - `pickItems`
85
- - `pickWeightedIndex`
86
- - `pickWeightedItem`
87
- - `shuffle`
88
- - `shuffleInPlace`
89
- - `toCumulativeValues`
81
+ ### Tooling
82
+
83
+ - *|tooling: Enable incremental type generation
84
+ - *|tooling: Rename publish script to avoid recursion
85
+
86
+ ## [3.0.0] - 2025-05-16
90
87
 
91
88
  ### Dependencies
92
89
 
93
- - Added dependencies:
94
- - @williamthorsen/toolbelt.numbers@3.0.0
90
+ - Arrays|deps: Add toolbelt.numbers to prod deps
91
+
92
+ ### Features
93
+
94
+ - Strings|feat: Add string functions
95
+ - Arrays|feat: Migrate from toolbelt-deno
96
+ - Objects|feat: Add legacy TypedObject and objectMap
97
+
98
+ ### Refactoring
99
+
100
+ - *|refactor: Rename functions
101
+
102
+ ### Tests
103
+
104
+ - Strings|tests: Adapt Deno tests to Vitest
105
+
106
+ ### Tooling
95
107
 
96
- ## 0.1.0
108
+ - Arrays|tooling: Scaffold the arrays workspace
97
109
 
98
- Copied from v0.1.0 of the `_template` workspace.
110
+ <!-- generated by git-cliff -->
package/dist/esm/.cache CHANGED
@@ -1 +1 @@
1
- 9e955c7486385f27c5f90b384583a3e36849311e897477522b4f14bd3e7aaf65
1
+ 9bf15adf9305be17f46d555787d2b674459d9d31d8d82778d123e61fab3844d5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamthorsen/toolbelt.arrays",
3
- "version": "3.3.1",
3
+ "version": "3.3.5",
4
4
  "description": "API",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/williamthorsen/toolbelt/tree/main/packages/arrays#readme",
@@ -29,8 +29,8 @@
29
29
  "CHANGELOG.md"
30
30
  ],
31
31
  "dependencies": {
32
- "@williamthorsen/toolbelt.guards": "3.1.0",
33
- "@williamthorsen/toolbelt.numbers": "4.3.0"
32
+ "@williamthorsen/toolbelt.guards": "3.1.4",
33
+ "@williamthorsen/toolbelt.numbers": "4.3.4"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=24.0.0"
@@ -1 +0,0 @@
1
- export declare function getDuplicates<T>(items: Iterable<T>): T[];
@@ -1,15 +0,0 @@
1
- function getDuplicates(items) {
2
- const duplicates = /* @__PURE__ */ new Set();
3
- const seen = /* @__PURE__ */ new Set();
4
- for (const item of items) {
5
- if (seen.has(item)) {
6
- duplicates.add(item);
7
- } else {
8
- seen.add(item);
9
- }
10
- }
11
- return [...duplicates];
12
- }
13
- export {
14
- getDuplicates
15
- };