@tsdotnet/array-utility 1.0.36 → 1.0.40

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.
Files changed (3) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +293 -294
  3. package/package.json +36 -57
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 electricessence (Oren F.)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 electricessence (Oren F.)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,294 +1,293 @@
1
- # ![alt text](https://avatars1.githubusercontent.com/u/64487547?s=30 "tsdotnet") tsdotnet / array-utility
2
-
3
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/tsdotnet/array-utility/blob/master/LICENSE)
4
- ![npm-publish](https://github.com/tsdotnet/array-utility/workflows/npm-publish/badge.svg)
5
- [![npm version](https://img.shields.io/npm/v/@tsdotnet/array-utility.svg?style=flat-square)](https://www.npmjs.com/package/@tsdotnet/array-utility)
6
-
7
- A small collection of useful array functions.
8
-
9
- ## Docs
10
-
11
- [tsdotnet.github.io/array-utility](https://tsdotnet.github.io/array-utility/)
12
-
13
- ## Usage
14
- ```typescript
15
- import * as arrayUtil from '@tsdotnet/array-utility'
16
- ```
17
-
18
- ## Exported
19
-
20
- ### indexOf
21
-
22
- ```typescript
23
- /**
24
- * Checks to see where the provided array contains an item/value.
25
- * If the array value is null, then -1 is returned.
26
- * @param array
27
- * @param item
28
- * @param {function?} equalityComparer
29
- * @returns {number}
30
- */
31
- export function indexOf<T> (
32
- array: ArrayLike<T>,
33
- item: T,
34
- equalityComparer: EqualityComparison<T> = areEqual
35
- ): number
36
- ```
37
-
38
- ### contains
39
-
40
- ```typescript
41
- /**
42
- * Checks to see if the provided array contains an item.
43
- * If the array value is null, then false is returned.
44
- * @param array
45
- * @param item
46
- * @param {function?} equalityComparer
47
- * @returns {boolean}
48
- */
49
- export function contains<T> (
50
- array: ArrayLike<T>,
51
- item: T,
52
- equalityComparer: EqualityComparison<T> = areEqual
53
- ): boolean
54
- ```
55
-
56
- ### replace
57
-
58
- ```typescript
59
- /**
60
- * Finds and replaces a value from an array. Will replaces all instances unless a maximum is specified.
61
- * @param array
62
- * @param old
63
- * @param newValue
64
- * @param max
65
- * @returns {number}
66
- */
67
- export function replace<T> (
68
- array: ArrayLikeWritable<T>,
69
- old: T,
70
- newValue: T,
71
- max: number = Infinity
72
- ): number
73
- ```
74
-
75
- ### updateRange
76
-
77
- ```typescript
78
- /**
79
- * Replaces values of an array across a range of indexes.
80
- * @param array
81
- * @param value
82
- * @param start
83
- * @param stop
84
- */
85
- export function updateRange<T> (
86
- array: ArrayLike<T>,
87
- value: T,
88
- start: number = 0,
89
- stop?: number
90
- ): void
91
-
92
- ```
93
-
94
- ### clearEach
95
-
96
- ```typescript
97
- /**
98
- * Clears (sets to null) values of an array across a range of indexes.
99
- * @param array
100
- * @param start
101
- * @param stop
102
- */
103
- export function clearEach (
104
- array: ArrayLikeWritable<any>,
105
- start: number = 0,
106
- stop?: number
107
- ): void
108
- ```
109
-
110
- ### register
111
-
112
- ```typescript
113
- /**
114
- * Ensures a value exists within an array. If not found, adds to the end.
115
- * @param array
116
- * @param item
117
- * @param {function?} equalityComparer
118
- * @returns {boolean}
119
- */
120
- export function register<T> (
121
- array: ArrayLikeWritable<T>,
122
- item: T,
123
- equalityComparer: EqualityComparison<T> = areEqual
124
- ): boolean
125
- ```
126
-
127
- ### findIndex
128
-
129
- ```typescript
130
- /**
131
- * Returns the first index of which the provided predicate returns true.
132
- * Returns -1 if always false.
133
- * @param array
134
- * @param predicate
135
- * @returns {number}
136
- */
137
- export function findIndex<T> (
138
- array: ArrayLike<T>,
139
- predicate: PredicateWithIndex<T>
140
- ): number
141
- ```
142
-
143
- ### forEach
144
-
145
- ```typescript
146
- /**
147
- * Allows for using "false" to cause forEach to break.
148
- * Can also be applied to a structure that indexes like an array, but may not be.
149
- * @param source
150
- * @param action
151
- */
152
- export function forEach<T> (
153
- source: ArrayLike<T>,
154
- action: ActionWithIndex<T> | PredicateWithIndex<T>
155
- ): void
156
- ```
157
-
158
- ### applyTo
159
-
160
- ```typescript
161
- /**
162
- * Is similar to Array.map() but instead of returning a new array, it updates the existing indexes.
163
- * Can also be applied to a structure that indexes like an array, but may not be.
164
- * @param target
165
- * @param fn
166
- */
167
- export function applyTo<T> (
168
- target: ArrayLikeWritable<T>,
169
- fn: SelectorWithIndex<T, T>
170
- ): void
171
- ```
172
-
173
- ### removeIndex
174
-
175
- ```typescript
176
- /**
177
- * Removes an entry at a specified index.
178
- * @param array
179
- * @param index
180
- * @returns {boolean} True if the value was able to be removed.
181
- */
182
- export function removeIndex<T> (
183
- array: T[],
184
- index: number
185
- ): boolean
186
- ```
187
-
188
- ### remove
189
-
190
- ```typescript
191
- /**
192
- * Finds and removes a value from an array. Will remove all instances unless a maximum is specified.
193
- * @param array
194
- * @param value
195
- * @param max
196
- * @param {function?} equalityComparer
197
- * @returns {number} The number of times the value was found and removed.
198
- */
199
- export function remove<T> (
200
- array: T[],
201
- value: T,
202
- max: number = Infinity,
203
- equalityComparer: EqualityComparison<T> = areEqual
204
- ): number
205
- ```
206
-
207
- ### repeat
208
-
209
- ```typescript
210
- /**
211
- * Simply repeats a value the number of times specified.
212
- * @param element
213
- * @param count
214
- * @returns {T[]}
215
- */
216
- export function repeat<T> (
217
- element: T,
218
- count: number
219
- ): T[]
220
- ```
221
-
222
- ### range
223
-
224
- ```typescript
225
- /**
226
- * Returns a range of numbers based upon the first value and the step value.
227
- * @param first
228
- * @param count
229
- * @param step
230
- * @returns {number[]}
231
- */
232
- export function range (
233
- first: number,
234
- count: number,
235
- step: number = 1
236
- ): number[]
237
- ```
238
-
239
- ### rangeUntil
240
-
241
- ```typescript
242
- /**
243
- * Returns a range of numbers based upon the first value and the step value excluding any numbers at or beyond the until value.
244
- * @param first
245
- * @param until
246
- * @param step
247
- * @returns {number[]}
248
- */
249
- export function rangeUntil (
250
- first: number,
251
- until: number,
252
- step: number = 1
253
- ): number[]
254
- ```
255
-
256
- ### distinct
257
-
258
- ```typescript
259
- /**
260
- * Returns a unique reduced set of values.
261
- * @param source
262
- */
263
- export function distinct (source: string[] | null): string[];
264
- export function distinct (source: number[] | null): number[];
265
- ```
266
-
267
- ### flatten
268
-
269
- ```typescript
270
- /**
271
- * Takes any arrays within an array and inserts the values contained within in place of that array.
272
- * For every count higher than 0 in recurseDepth it will attempt an additional pass. Passing Infinity will flatten all arrays contained.
273
- * @param a
274
- * @param recurseDepth
275
- * @returns {any[]}
276
- */
277
- export function flatten (
278
- a: any[],
279
- recurseDepth: number = 0
280
- ): any[]
281
- ```
282
-
283
- ### init
284
-
285
- https://github.com/tsdotnet/array-init
286
-
287
- `arrayInit as init`
288
-
289
- ### copy, copyTo
290
-
291
- https://github.com/tsdotnet/array-copy
292
-
293
- `arrayCopy as copy`
294
- `arrayCopyTo as copyTo`
1
+ # ![alt text](https://avatars1.githubusercontent.com/u/64487547?s=30 "tsdotnet") tsdotnet / array-utility
2
+
3
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/tsdotnet/array-utility/blob/master/LICENSE)
4
+ [![npm version](https://img.shields.io/npm/v/@tsdotnet/array-utility.svg?style=flat-square)](https://www.npmjs.com/package/@tsdotnet/array-utility)
5
+
6
+ A small collection of useful array functions.
7
+
8
+ ## Docs
9
+
10
+ [tsdotnet.github.io/array-utility](https://tsdotnet.github.io/array-utility/)
11
+
12
+ ## Usage
13
+ ```typescript
14
+ import * as arrayUtil from '@tsdotnet/array-utility'
15
+ ```
16
+
17
+ ## Exported
18
+
19
+ ### indexOf
20
+
21
+ ```typescript
22
+ /**
23
+ * Checks to see where the provided array contains an item/value.
24
+ * If the array value is null, then -1 is returned.
25
+ * @param array
26
+ * @param item
27
+ * @param {function?} equalityComparer
28
+ * @returns {number}
29
+ */
30
+ export function indexOf<T> (
31
+ array: ArrayLike<T>,
32
+ item: T,
33
+ equalityComparer: EqualityComparison<T> = areEqual
34
+ ): number
35
+ ```
36
+
37
+ ### contains
38
+
39
+ ```typescript
40
+ /**
41
+ * Checks to see if the provided array contains an item.
42
+ * If the array value is null, then false is returned.
43
+ * @param array
44
+ * @param item
45
+ * @param {function?} equalityComparer
46
+ * @returns {boolean}
47
+ */
48
+ export function contains<T> (
49
+ array: ArrayLike<T>,
50
+ item: T,
51
+ equalityComparer: EqualityComparison<T> = areEqual
52
+ ): boolean
53
+ ```
54
+
55
+ ### replace
56
+
57
+ ```typescript
58
+ /**
59
+ * Finds and replaces a value from an array. Will replaces all instances unless a maximum is specified.
60
+ * @param array
61
+ * @param old
62
+ * @param newValue
63
+ * @param max
64
+ * @returns {number}
65
+ */
66
+ export function replace<T> (
67
+ array: ArrayLikeWritable<T>,
68
+ old: T,
69
+ newValue: T,
70
+ max: number = Infinity
71
+ ): number
72
+ ```
73
+
74
+ ### updateRange
75
+
76
+ ```typescript
77
+ /**
78
+ * Replaces values of an array across a range of indexes.
79
+ * @param array
80
+ * @param value
81
+ * @param start
82
+ * @param stop
83
+ */
84
+ export function updateRange<T> (
85
+ array: ArrayLike<T>,
86
+ value: T,
87
+ start: number = 0,
88
+ stop?: number
89
+ ): void
90
+
91
+ ```
92
+
93
+ ### clearEach
94
+
95
+ ```typescript
96
+ /**
97
+ * Clears (sets to null) values of an array across a range of indexes.
98
+ * @param array
99
+ * @param start
100
+ * @param stop
101
+ */
102
+ export function clearEach (
103
+ array: ArrayLikeWritable<any>,
104
+ start: number = 0,
105
+ stop?: number
106
+ ): void
107
+ ```
108
+
109
+ ### register
110
+
111
+ ```typescript
112
+ /**
113
+ * Ensures a value exists within an array. If not found, adds to the end.
114
+ * @param array
115
+ * @param item
116
+ * @param {function?} equalityComparer
117
+ * @returns {boolean}
118
+ */
119
+ export function register<T> (
120
+ array: ArrayLikeWritable<T>,
121
+ item: T,
122
+ equalityComparer: EqualityComparison<T> = areEqual
123
+ ): boolean
124
+ ```
125
+
126
+ ### findIndex
127
+
128
+ ```typescript
129
+ /**
130
+ * Returns the first index of which the provided predicate returns true.
131
+ * Returns -1 if always false.
132
+ * @param array
133
+ * @param predicate
134
+ * @returns {number}
135
+ */
136
+ export function findIndex<T> (
137
+ array: ArrayLike<T>,
138
+ predicate: PredicateWithIndex<T>
139
+ ): number
140
+ ```
141
+
142
+ ### forEach
143
+
144
+ ```typescript
145
+ /**
146
+ * Allows for using "false" to cause forEach to break.
147
+ * Can also be applied to a structure that indexes like an array, but may not be.
148
+ * @param source
149
+ * @param action
150
+ */
151
+ export function forEach<T> (
152
+ source: ArrayLike<T>,
153
+ action: ActionWithIndex<T> | PredicateWithIndex<T>
154
+ ): void
155
+ ```
156
+
157
+ ### applyTo
158
+
159
+ ```typescript
160
+ /**
161
+ * Is similar to Array.map() but instead of returning a new array, it updates the existing indexes.
162
+ * Can also be applied to a structure that indexes like an array, but may not be.
163
+ * @param target
164
+ * @param fn
165
+ */
166
+ export function applyTo<T> (
167
+ target: ArrayLikeWritable<T>,
168
+ fn: SelectorWithIndex<T, T>
169
+ ): void
170
+ ```
171
+
172
+ ### removeIndex
173
+
174
+ ```typescript
175
+ /**
176
+ * Removes an entry at a specified index.
177
+ * @param array
178
+ * @param index
179
+ * @returns {boolean} True if the value was able to be removed.
180
+ */
181
+ export function removeIndex<T> (
182
+ array: T[],
183
+ index: number
184
+ ): boolean
185
+ ```
186
+
187
+ ### remove
188
+
189
+ ```typescript
190
+ /**
191
+ * Finds and removes a value from an array. Will remove all instances unless a maximum is specified.
192
+ * @param array
193
+ * @param value
194
+ * @param max
195
+ * @param {function?} equalityComparer
196
+ * @returns {number} The number of times the value was found and removed.
197
+ */
198
+ export function remove<T> (
199
+ array: T[],
200
+ value: T,
201
+ max: number = Infinity,
202
+ equalityComparer: EqualityComparison<T> = areEqual
203
+ ): number
204
+ ```
205
+
206
+ ### repeat
207
+
208
+ ```typescript
209
+ /**
210
+ * Simply repeats a value the number of times specified.
211
+ * @param element
212
+ * @param count
213
+ * @returns {T[]}
214
+ */
215
+ export function repeat<T> (
216
+ element: T,
217
+ count: number
218
+ ): T[]
219
+ ```
220
+
221
+ ### range
222
+
223
+ ```typescript
224
+ /**
225
+ * Returns a range of numbers based upon the first value and the step value.
226
+ * @param first
227
+ * @param count
228
+ * @param step
229
+ * @returns {number[]}
230
+ */
231
+ export function range (
232
+ first: number,
233
+ count: number,
234
+ step: number = 1
235
+ ): number[]
236
+ ```
237
+
238
+ ### rangeUntil
239
+
240
+ ```typescript
241
+ /**
242
+ * Returns a range of numbers based upon the first value and the step value excluding any numbers at or beyond the until value.
243
+ * @param first
244
+ * @param until
245
+ * @param step
246
+ * @returns {number[]}
247
+ */
248
+ export function rangeUntil (
249
+ first: number,
250
+ until: number,
251
+ step: number = 1
252
+ ): number[]
253
+ ```
254
+
255
+ ### distinct
256
+
257
+ ```typescript
258
+ /**
259
+ * Returns a unique reduced set of values.
260
+ * @param source
261
+ */
262
+ export function distinct (source: string[] | null): string[];
263
+ export function distinct (source: number[] | null): number[];
264
+ ```
265
+
266
+ ### flatten
267
+
268
+ ```typescript
269
+ /**
270
+ * Takes any arrays within an array and inserts the values contained within in place of that array.
271
+ * For every count higher than 0 in recurseDepth it will attempt an additional pass. Passing Infinity will flatten all arrays contained.
272
+ * @param a
273
+ * @param recurseDepth
274
+ * @returns {any[]}
275
+ */
276
+ export function flatten (
277
+ a: any[],
278
+ recurseDepth: number = 0
279
+ ): any[]
280
+ ```
281
+
282
+ ### init
283
+
284
+ https://github.com/tsdotnet/array-init
285
+
286
+ `arrayInit as init`
287
+
288
+ ### copy, copyTo
289
+
290
+ https://github.com/tsdotnet/array-copy
291
+
292
+ `arrayCopy as copy`
293
+ `arrayCopyTo as copyTo`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsdotnet/array-utility",
3
- "version": "1.0.36",
3
+ "version": "1.0.40",
4
4
  "description": "A small collection of useful array functions.",
5
5
  "author": "electricessence",
6
6
  "license": "MIT",
@@ -35,23 +35,6 @@
35
35
  "copy",
36
36
  "copyTo"
37
37
  ],
38
- "scripts": {
39
- "clean": "rimraf dist",
40
- "build:types": "cpy \"src/**/*.d.ts\" dist/types --parents && tsc -p tsconfig.types.json",
41
- "build:esm": "rollup -c rollup.config.js",
42
- "build:cjs": "tsc -p tsconfig.cjs.json",
43
- "build": "pnpm clean && pnpm build:types && pnpm build:esm && pnpm build:cjs && pnpm typecheck:tests",
44
- "test": "vitest run",
45
- "typecheck": "tsc --noEmit",
46
- "typecheck:tests": "tsc -p tests/tsconfig.json --noEmit",
47
- "lint": "eslint src/**/*.ts",
48
- "docs": "rimraf docs && typedoc --options typedoc.json --readme none",
49
- "bump": "pnpm run precommit && pnpm version patch",
50
- "precommit": "pnpm build && pnpm test && pnpm lint && git status -s",
51
- "preversion": "pnpm lint && pnpm test",
52
- "postversion": "git push && git push --tags && pnpm run docs && git add -A && git commit -m \"Updated docs.\" docs && git push",
53
- "prepublishOnly": "pnpm build && pnpm test && pnpm lint"
54
- },
55
38
  "repository": {
56
39
  "type": "git",
57
40
  "url": "git+https://github.com/tsdotnet/array-utility.git"
@@ -61,48 +44,44 @@
61
44
  },
62
45
  "homepage": "https://github.com/tsdotnet/array-utility#readme",
63
46
  "devDependencies": {
64
- "@eslint/js": "^9.34.0",
65
- "@rollup/plugin-typescript": "^12.1.4",
66
- "@types/node": "^24.3.0",
67
- "@vitest/coverage-v8": "^3.2.4",
68
- "cpy-cli": "^6.0.0",
69
- "eslint": "^9.34.0",
70
- "rimraf": "^6.0.1",
71
- "rollup": "^4.48.1",
72
- "typedoc": "^0.28.11",
73
- "typescript": "^5.9.2",
74
- "typescript-eslint": "^8.41.0",
75
- "vitest": "^3.2.4"
47
+ "@eslint/js": "^10.0.1",
48
+ "@rollup/plugin-typescript": "^12.3.0",
49
+ "@types/node": "^25.5.0",
50
+ "@vitest/coverage-v8": "^4.1.0",
51
+ "cpy-cli": "^7.0.0",
52
+ "eslint": "^10.0.3",
53
+ "rimraf": "^6.1.3",
54
+ "rollup": "^4.59.0",
55
+ "typedoc": "^0.28.17",
56
+ "typescript": "^5.9.3",
57
+ "typescript-eslint": "^8.57.1",
58
+ "vitest": "^4.1.0"
76
59
  },
77
60
  "dependencies": {
78
- "@tsdotnet/array-copy": "^1.2.3",
79
- "@tsdotnet/array-init": "^1.2.3",
61
+ "@tsdotnet/array-copy": "^1.2.5",
62
+ "@tsdotnet/array-init": "^1.2.4",
80
63
  "@tsdotnet/common-interfaces": "^1.0.6",
81
- "@tsdotnet/compare": "^1.7.2",
82
- "@tsdotnet/exceptions": "^1.2.5",
83
- "@tsdotnet/integer": "^1.2.4",
84
- "@tsdotnet/type": "^1.2.6",
64
+ "@tsdotnet/compare": "^1.7.5",
65
+ "@tsdotnet/exceptions": "^1.2.9",
66
+ "@tsdotnet/integer": "^1.2.8",
67
+ "@tsdotnet/type": "^1.2.8",
85
68
  "tslib": "^2.8.1"
86
69
  },
87
- "pnpm": {
88
- "overrides": {
89
- "hosted-git-info@<2.8.9": ">=2.8.9",
90
- "y18n@=4.0.0": ">=4.0.1",
91
- "lodash@<4.17.20": ">=4.17.20",
92
- "shell-quote@<=1.7.2": ">=1.7.3",
93
- "lodash@<4.17.21": ">=4.17.21",
94
- "json5@<1.0.2": ">=1.0.2",
95
- "json5@>=2.0.0 <2.2.2": ">=2.2.2",
96
- "minimatch@<3.0.5": ">=3.0.5",
97
- "semver@<5.7.2": ">=5.7.2",
98
- "semver@>=6.0.0 <6.3.1": ">=6.3.1",
99
- "semver@>=7.0.0 <7.5.2": ">=7.5.2",
100
- "get-func-name@<2.0.1": ">=2.0.1",
101
- "@babel/traverse@<7.23.2": ">=7.23.2",
102
- "braces@<3.0.3": ">=3.0.3"
103
- },
104
- "ignoredBuiltDependencies": [
105
- "esbuild"
106
- ]
70
+ "scripts": {
71
+ "clean": "rimraf dist",
72
+ "copy:dts": "cpy \"src/**/*.d.ts\" dist/types --parents || echo No .d.ts files to copy",
73
+ "build:types": "pnpm copy:dts && tsc -p tsconfig.types.json",
74
+ "build:esm": "rollup -c rollup.config.js",
75
+ "build:cjs": "tsc -p tsconfig.cjs.json",
76
+ "build": "pnpm clean && pnpm build:types && pnpm build:esm && pnpm build:cjs && pnpm typecheck:tests",
77
+ "test": "vitest run",
78
+ "typecheck": "tsc --noEmit",
79
+ "typecheck:tests": "tsc -p tests/tsconfig.json --noEmit",
80
+ "lint": "eslint src/**/*.ts",
81
+ "docs": "rimraf docs && typedoc --options typedoc.json --readme none",
82
+ "bump": "pnpm run precommit && pnpm version patch",
83
+ "precommit": "pnpm build && pnpm test && pnpm lint && git status -s",
84
+ "preversion": "pnpm lint && pnpm test",
85
+ "postversion": "git push && git push --tags && pnpm run docs && git add -A && git commit -m \"Updated docs.\" docs && git push"
107
86
  }
108
- }
87
+ }