Skip to content

Commit 17df0bc

Browse files
committed
Auto-generated commit
1 parent a454738 commit 17df0bc

File tree

6 files changed

+35
-252
lines changed

6 files changed

+35
-252
lines changed

.github/workflows/npm_downloads.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ jobs:
8686
8787
# Upload the download data:
8888
- name: 'Upload data'
89-
# Pin action to full length commit SHA corresponding to v3.1.3
90-
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
89+
# Pin action to full length commit SHA
90+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
9191
with:
9292
# Define a name for the uploaded artifact (ensuring a unique name for each job):
9393
name: npm_downloads

.github/workflows/publish.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,10 @@ jobs:
124124
mv ./package.json.tmp ./package.json
125125
fi
126126
done
127-
jq -r '.devDependencies | keys[]' ./package.json | while read -r dep; do
128-
if [[ "$dep" != "@stdlib"* ]]; then
129-
continue
130-
fi
131-
dep=$(echo "$dep" | xargs)
132-
if ! find lib -name "*.js" -exec grep -q "$dep" {} + && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
133-
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
134-
mv ./package.json.tmp ./package.json
135-
fi
136-
done
127+
128+
# Set `devDependencies` to an empty object:
129+
jq --indent 2 '.devDependencies = {}' ./package.json > ./package.json.tmp
130+
mv ./package.json.tmp ./package.json
137131
138132
# Remove CLI section:
139133
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"cli\">[\s\S]+?<\!\-\- \/.cli \-\->//"

.github/workflows/test_bundles.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ jobs:
168168

169169
# Install Deno:
170170
- name: 'Install Deno'
171-
# Pin action to full length commit SHA corresponding to v1.1.2
172-
uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31
171+
# Pin action to full length commit SHA
172+
uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba # v1.1.4
173173
with:
174174
deno-version: vx.x.x
175175

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
215215
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-empty.svg
216216
[npm-url]: https://npmjs.org/package/@stdlib/array-empty
217217

218-
[test-image]: https://github.com/stdlib-js/array-empty/actions/workflows/test.yml/badge.svg?branch=v0.2.0
219-
[test-url]: https://github.com/stdlib-js/array-empty/actions/workflows/test.yml?query=branch:v0.2.0
218+
[test-image]: https://github.com/stdlib-js/array-empty/actions/workflows/test.yml/badge.svg?branch=main
219+
[test-url]: https://github.com/stdlib-js/array-empty/actions/workflows/test.yml?query=branch:main
220220

221221
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-empty/main.svg
222222
[coverage-url]: https://codecov.io/github/stdlib-js/array-empty?branch=main

docs/types/index.d.ts

+8-219
Original file line numberDiff line numberDiff line change
@@ -20,228 +20,11 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Complex128Array, Complex64Array, DataType } from '@stdlib/types/array';
23+
import { DataTypeMap } from '@stdlib/types/array';
2424

2525
/**
2626
* Creates an uninitialized array having a specified length.
2727
*
28-
* ## Notes
29-
*
30-
* - In browser environments, the function always returns zero-filled arrays.
31-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
32-
*
33-
* @param length - array length
34-
* @param dtype - data type
35-
* @returns empty array
36-
*
37-
* @example
38-
* var arr = empty( 2, 'float64' );
39-
* // returns <Float64Array>
40-
*/
41-
declare function empty( length: number, dtype: 'float64' ): Float64Array;
42-
43-
/**
44-
* Creates an uninitialized array having a specified length.
45-
*
46-
* ## Notes
47-
*
48-
* - In browser environments, the function always returns zero-filled arrays.
49-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
50-
*
51-
* @param length - array length
52-
* @param dtype - data type
53-
* @returns empty array
54-
*
55-
* @example
56-
* var arr = empty( 2, 'float32' );
57-
* // returns <Float32Array>
58-
*/
59-
declare function empty( length: number, dtype: 'float32' ): Float32Array;
60-
61-
/**
62-
* Creates an uninitialized array having a specified length.
63-
*
64-
* ## Notes
65-
*
66-
* - In browser environments, the function always returns zero-filled arrays.
67-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
68-
*
69-
* @param length - array length
70-
* @param dtype - data type
71-
* @returns empty array
72-
*
73-
* @example
74-
* var arr = empty( 2, 'complex128' );
75-
* // returns <Complex128Array>
76-
*/
77-
declare function empty( length: number, dtype: 'complex128' ): Complex128Array;
78-
79-
/**
80-
* Creates an uninitialized array having a specified length.
81-
*
82-
* ## Notes
83-
*
84-
* - In browser environments, the function always returns zero-filled arrays.
85-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
86-
*
87-
* @param length - array length
88-
* @param dtype - data type
89-
* @returns empty array
90-
*
91-
* @example
92-
* var arr = empty( 2, 'complex64' );
93-
* // returns <Complex64Array>
94-
*/
95-
declare function empty( length: number, dtype: 'complex64' ): Complex64Array;
96-
97-
/**
98-
* Creates an uninitialized array having a specified length.
99-
*
100-
* ## Notes
101-
*
102-
* - In browser environments, the function always returns zero-filled arrays.
103-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
104-
*
105-
* @param length - array length
106-
* @param dtype - data type
107-
* @returns empty array
108-
*
109-
* @example
110-
* var arr = empty( 2, 'int32' );
111-
* // returns <Int32Array>
112-
*/
113-
declare function empty( length: number, dtype: 'int32' ): Int32Array;
114-
115-
/**
116-
* Creates an uninitialized array having a specified length.
117-
*
118-
* ## Notes
119-
*
120-
* - In browser environments, the function always returns zero-filled arrays.
121-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
122-
*
123-
* @param length - array length
124-
* @param dtype - data type
125-
* @returns empty array
126-
*
127-
* @example
128-
* var arr = empty( 2, 'int16' );
129-
* // returns <Int16Array>
130-
*/
131-
declare function empty( length: number, dtype: 'int16' ): Int16Array;
132-
133-
/**
134-
* Creates an uninitialized array having a specified length.
135-
*
136-
* ## Notes
137-
*
138-
* - In browser environments, the function always returns zero-filled arrays.
139-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
140-
*
141-
* @param length - array length
142-
* @param dtype - data type
143-
* @returns empty array
144-
*
145-
* @example
146-
* var arr = empty( 2, 'int8' );
147-
* // returns <Int8Array>
148-
*/
149-
declare function empty( length: number, dtype: 'int8' ): Int8Array;
150-
151-
/**
152-
* Creates an uninitialized array having a specified length.
153-
*
154-
* ## Notes
155-
*
156-
* - In browser environments, the function always returns zero-filled arrays.
157-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
158-
*
159-
* @param length - array length
160-
* @param dtype - data type
161-
* @returns empty array
162-
*
163-
* @example
164-
* var arr = empty( 2, 'uint32' );
165-
* // returns <Uint32Array>
166-
*/
167-
declare function empty( length: number, dtype: 'uint32' ): Uint32Array;
168-
169-
/**
170-
* Creates an uninitialized array having a specified length.
171-
*
172-
* ## Notes
173-
*
174-
* - In browser environments, the function always returns zero-filled arrays.
175-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
176-
*
177-
* @param length - array length
178-
* @param dtype - data type
179-
* @returns empty array
180-
*
181-
* @example
182-
* var arr = empty( 2, 'uint16' );
183-
* // returns <Uint16Array>
184-
*/
185-
declare function empty( length: number, dtype: 'uint16' ): Uint16Array;
186-
187-
/**
188-
* Creates an uninitialized array having a specified length.
189-
*
190-
* ## Notes
191-
*
192-
* - In browser environments, the function always returns zero-filled arrays.
193-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
194-
*
195-
* @param length - array length
196-
* @param dtype - data type
197-
* @returns empty array
198-
*
199-
* @example
200-
* var arr = empty( 2, 'uint8' );
201-
* // returns <Uint8Array>
202-
*/
203-
declare function empty( length: number, dtype: 'uint8' ): Uint8Array;
204-
205-
/**
206-
* Creates an uninitialized array having a specified length.
207-
*
208-
* ## Notes
209-
*
210-
* - In browser environments, the function always returns zero-filled arrays.
211-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
212-
*
213-
* @param length - array length
214-
* @param dtype - data type
215-
* @returns empty array
216-
*
217-
* @example
218-
* var arr = empty( 2, 'uint8c' );
219-
* // returns <Uint8ClampedArray>
220-
*/
221-
declare function empty( length: number, dtype: 'uint8c' ): Uint8ClampedArray;
222-
223-
/**
224-
* Creates a zero-filled array having a specified length.
225-
*
226-
* @param length - array length
227-
* @param dtype - data type
228-
* @returns zero-filled array
229-
*
230-
* @example
231-
* var arr = empty( 2, 'generic' );
232-
* // returns
233-
*/
234-
declare function empty( length: number, dtype: 'generic' ): Array<number>;
235-
236-
/**
237-
* Creates an uninitialized array having a specified length.
238-
*
239-
* ## Notes
240-
*
241-
* - In browser environments, the function always returns zero-filled arrays.
242-
* - If `dtype` is `'generic'`, the function always returns a zero-filled array.
243-
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
244-
*
24528
* The function recognizes the following data types:
24629
*
24730
* - `float64`: double-precision floating-point numbers (IEEE 754)
@@ -257,6 +40,12 @@ declare function empty( length: number, dtype: 'generic' ): Array<number>;
25740
* - `uint8c`: 8-bit unsigned integers clamped to `0-255`
25841
* - `generic`: generic JavaScript values
25942
*
43+
* ## Notes
44+
*
45+
* - In browser environments, the function always returns zero-filled arrays.
46+
* - If `dtype` is `'generic'`, the function always returns a zero-filled array.
47+
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
48+
*
26049
* @param length - array length
26150
* @param dtype - data type (default: 'float64')
26251
* @returns empty array
@@ -269,7 +58,7 @@ declare function empty( length: number, dtype: 'generic' ): Array<number>;
26958
* var arr = empty( 2, 'float32' );
27059
* // returns <Float32Array>
27160
*/
272-
declare function empty( length: number, dtype?: DataType ): Float64Array;
61+
declare function empty<T extends keyof DataTypeMap<number> = 'float64'>( length: number, dtype?: T ): DataTypeMap<number>[T];
27362

27463

27564
// EXPORTS //

package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,31 @@
4343
"@stdlib/array-typed-ctors": "^0.2.0",
4444
"@stdlib/array-zeros": "^0.2.0",
4545
"@stdlib/assert-is-nonnegative-integer": "^0.2.0",
46-
"@stdlib/assert-is-uint8array": "^0.2.0",
46+
"@stdlib/assert-is-uint8array": "^0.2.1",
4747
"@stdlib/buffer-alloc-unsafe": "^0.2.0",
4848
"@stdlib/ndarray-base-bytes-per-element": "^0.2.0",
49-
"@stdlib/string-format": "^0.2.0",
50-
"@stdlib/types": "^0.3.1"
49+
"@stdlib/string-format": "^0.2.1",
50+
"@stdlib/types": "^0.3.2"
5151
},
5252
"devDependencies": {
53-
"@stdlib/array-complex128": "^0.1.0",
54-
"@stdlib/array-complex64": "^0.1.0",
53+
"@stdlib/array-complex128": "^0.2.0",
54+
"@stdlib/array-complex64": "^0.2.0",
5555
"@stdlib/array-dtypes": "^0.2.0",
56-
"@stdlib/array-float32": "^0.2.0",
57-
"@stdlib/array-float64": "^0.2.0",
58-
"@stdlib/array-int16": "^0.2.0",
59-
"@stdlib/array-int32": "^0.2.0",
60-
"@stdlib/array-int8": "^0.2.0",
61-
"@stdlib/array-uint16": "^0.2.0",
62-
"@stdlib/array-uint32": "^0.2.0",
63-
"@stdlib/array-uint8": "^0.2.0",
64-
"@stdlib/array-uint8c": "^0.2.0",
65-
"@stdlib/assert-instance-of": "^0.2.0",
66-
"@stdlib/assert-is-array": "^0.2.0",
56+
"@stdlib/array-float32": "^0.2.1",
57+
"@stdlib/array-float64": "^0.2.1",
58+
"@stdlib/array-int16": "^0.2.1",
59+
"@stdlib/array-int32": "^0.2.1",
60+
"@stdlib/array-int8": "^0.2.1",
61+
"@stdlib/array-uint16": "^0.2.1",
62+
"@stdlib/array-uint32": "^0.2.1",
63+
"@stdlib/array-uint8": "^0.2.1",
64+
"@stdlib/array-uint8c": "^0.2.1",
65+
"@stdlib/assert-instance-of": "^0.2.1",
66+
"@stdlib/assert-is-array": "^0.2.1",
6767
"@stdlib/assert-is-typed-array": "^0.2.0",
6868
"@stdlib/assert-is-typed-array-like": "^0.2.0",
6969
"@stdlib/math-base-special-pow": "^0.2.0",
70-
"@stdlib/strided-base-reinterpret-complex128": "^0.2.0",
70+
"@stdlib/strided-base-reinterpret-complex128": "^0.2.1",
7171
"@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
7272
"proxyquire": "^2.0.0",
7373
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

0 commit comments

Comments
 (0)