8000 Auto-generated commit · stdlib-js/array-full@996e98e · GitHub
[go: up one dir, main page]

Skip to content

Commit 996e98e

Browse files
committed
Auto-generated commit
1 parent f8ef476 commit 996e98e

File tree

7 files changed

+31
-209
lines changed

7 files changed

+31
-209
lines changed

.github/workflows/npm_downloads.yml

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 10 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
207207
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-full.svg
208208
[npm-url]: https://npmjs.org/package/@stdlib/array-full
209209

210-
[test-image]: https://github.com/stdlib-js/array-full/actions/workflows/test.yml/badge.svg?branch=v0.2.0
211-
[test-url]: https://github.com/stdlib-js/array-full/actions/workflows/test.yml?query=branch:v0.2.0
210+
[test-image]: https://github.com/stdlib-js/array-full/actions/workflows/test.yml/badge.svg?branch=main
211+
[test-url]: https://github.com/stdlib-js/array-full/actions/workflows/test.yml?query=branch:main
212212

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

docs/types/index.d.ts

Lines changed: 2 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -20,180 +20,7 @@
2020

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

23-
import { AnyArray, Complex128Array, Complex64Array, DataType } from '@stdlib/types/array';
24-
import { ComplexLike } from '@stdlib/types/complex';
25-
26-
/**
27-
* Creates a filled array having a specified length.
28-
*
29-
* @param length - array length
30-
* @param value - fill value
31-
* @param dtype - data type
32-
* @returns filled array
33-
*
34-
* @example
35-
* var arr = full( 2, 1.0, 'float64' );
36-
* // returns <Float64Array>[ 1.0, 1.0 ]
37-
*/
38-
declare function full( length: number, value: number, dtype: 'float64' ): Float64Array;
39-
40-
/**
41-
* Creates a filled array having a specified length.
42-
*
43-
* @param length - array length
44-
* @param value - fill value
45-
* @param dtype - data type
46-
* @returns filled array
47-
*
48-
* @example
49-
* var arr = full( 2, 1.0, 'float32' );
50-
* // returns <Float32Array>[ 1.0, 1.0 ]
51-
*/
52-
declare function full( length: number, value: number, dtype: 'float32' ): Float32Array;
53-
54-
/**
55-
* Creates a filled array having a specified length.
56-
*
57-
* @param length - array length
58-
* @param value - fill value
59-
* @param dtype - data type
60-
* @returns filled array
61-
*
62-
* @example
63-
* var Complex128 = require( '@stdlib/complex-float64' );
64-
*
65-
* var arr = full( 2, new Complex128( 1.0, 2.0 ), 'complex128' );
66-
* // returns <Complex128Array>
67-
*/
68-
declare function full( length: number, value: ComplexLike, dtype: 'complex128' ): Complex128Array;
69-
70-
/**
71-
* Creates a filled array having a specified length.
72-
*
73-
* @param length - array length
74-
* @param value - fill value
75-
* @param dtype - data type
76-
* @returns filled array
77-
*
78-
* @example
79-
* var Complex64 = require( '@stdlib/complex-float32' );
80-
*
81-
* var arr = full( 2, new Complex64( 1.0, 2.0 ), 'complex64' );
82-
* // returns <Complex64Array>
83-
*/
84-
declare function full( length: number, value: ComplexLike, dtype: 'complex64' ): Complex64Array;
85-
86-
/**
87-
* Creates a filled array having a specified length.
88-
*
89-
* @param length - array length
90-
* @param value - fill value
91-
* @param dtype - data type
92-
* @returns filled array
93-
*
94-
* @example
95-
* var arr = full( 2, 1, 'int32' );
96-
* // returns <Int32Array>[ 1, 1 ]
97-
*/
98-
declare function full( length: number, value: number, dtype: 'int32' ): Int32Array;
99-
100-
/**
101-
* Creates a filled array having a specified length.
102-
*
103-
* @param length - array length
104-
* @param value - fill value
105-
* @param dtype - data type
106-
* @returns filled array
107-
*
108-
* @example
109-
* var arr = full( 2, 1, 'int16' );
110-
* // returns <Int16Array>[ 1, 1 ]
111-
*/
112-
declare function full( length: number, value: number, dtype: 'int16' ): Int16Array;
113-
114-
/**
115-
* Creates a filled array having a specified length.
116-
*
117-
* @param length - array length
118-
* @param value - fill value
119-
* @param dtype - data type
120-
* @returns filled array
121-
*
122-
* @example
123-
* var arr = full( 2, 1, 'int8' );
124-
* // returns <Int8Array>[ 1, 1 ]
125-
*/
126-
declare function full( length: number, value: number, dtype: 'int8' ): Int8Array;
127-
128-
/**
129-
* Creates a filled array having a specified length.
130-
*
131-
* @param length - array length
132-
* @param value - fill value
133-
* @param dtype - data type
134-
* @returns filled array
135-
*
136-
* @example
137-
* var arr = full( 2, 1, 'uint32' );
138-
* // returns <Uint32Array>[ 1, 1 ]
139-
*/
140-
declare function full( length: number, value: number, dtype: 'uint32' ): Uint32Array;
141-
142-
/**
143-
* Creates a filled array having a specified length.
144-
*
145-
* @param length - array length
146-
* @param value - fill value
147-
* @param dtype - data type
148-
* @returns filled array
149-
*
150-
* @example
151-
* var arr = full( 2, 1, 'uint16' );
152-
* // returns <Uint16Array>[ 1, 1 ]
153-
*/
154-
declare function full( length: number, value: number, dtype: 'uint16' ): Uint16Array;
155-
156-
/**
157-
* Creates a filled array having a specified length.
158-
*
159-
* @param length - array length
160-
* @param value - fill value
161-
* @param dtype - data type
162-
* @returns filled array
163-
*
164-
* @example
165-
* var arr = full( 2, 1, 'uint8' );
166-
* // returns <Uint8Array>[ 1, 1 ]
167-
*/
168-
declare function full( length: number, value: number, dtype: 'uint8' ): Uint8Array;
169-
170-
/**
171-
* Creates a filled array having a specified length.
172-
*
173-
* @param length - array length
174-
* @param value - fill value
175-
* @param dtype - data type
176-
* @returns filled array
177-
*
178-
* @example
179-
* var arr = full( 2, 1, 'uint8c' );
180-
* // returns <Uint8ClampedArray>[ 1, 1 ]
< F438 code>181-
*/
182-
declare function full( length: number, value: number, dtype: 'uint8c' ): Uint8ClampedArray;
183-
184-
/**
185-
* Creates a filled array having a specified length.
186-
*
187-
* @param length - array length
188-
* @param value - fill value
189-
* @param dtype - data type
190-
* @returns filled array
191-
*
192-
* @example
193-
* var arr = full( 2, 1, 'generic' );
194-
* // returns [ 1, 1 ]
195-
*/
196-
declare function full( length: number, value: any, dtype: 'generic' ): Array<any>;
23+
import { DataTypeMap } from '@stdlib/types/array';
19724

19825
/**
19926
* Creates a filled array having a specified length.
@@ -226,7 +53,7 @@ declare function full( length: number, value: any, dtype: 'generic' ): Array<any
22653
* var arr = full( 2, 1.0, 'float32' );
22754
* // returns <Float32Array>[ 1.0, 1.0 ]
22855
*/
229-
declare function full( length: number, value: any, dtype?: DataType ): AnyArray;
56+
declare function full<T, U extends keyof DataTypeMap<number> = 'float64'>( length: number, value: T, dtype?: U ): DataTypeMap<T>[U];
23057

23158

23259
// EXPORTS //

docs/types/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import full = require( './index' );
2626
{
2727
const z = new Complex128( 1.0, 2.0 );
2828

29-
full( 10, 1 ); // $ExpectType AnyArray
29+
full( 10, 1 ); // $ExpectType Float64Array
3030
full( 10, 1, 'float64' ); // $ExpectType Float64Array
3131
full( 10, 1, 'float32' ); // $ExpectType Float32Array
3232
full( 10, z, 'complex128' ); // $ExpectType Complex128Array
@@ -38,7 +38,8 @@ import full = require( './index' );
3838
full( 10, 1, 'uint16' ); // $ExpectType Uint16Array
3939
full( 10, 1, 'uint8' ); // $ExpectType Uint8Array
4040
full( 10, 1, 'uint8c' ); // $ExpectType Uint8ClampedArray
41-
full( 10, 1, 'generic' ); // $ExpectType any[]
41+
full( 10, 1, 'generic' ); // $ExpectType number[]
42+
full( 10, 'abc', 'generic' ); // $ExpectType string[]
4243
}
4344

4445
// The compiler throws an error if the function is not provided a number for the first argument...

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,30 @@
4242
"@stdlib/array-defaults": "^0.2.0",
4343
"@stdlib/assert-is-nonnegative-integer": "^0.2.0",
4444
"@stdlib/blas-ext-base-gfill": "^0.2.0",
45-
"@stdlib/string-format": "^0.2.0",
46-
"@stdlib/types": "^0.3.1"
45+
"@stdlib/string-format": "^0.2.1",
46+
"@stdlib/types": "^0.3.2"
4747
},
4848
"devDependencies": {
49-
"@stdlib/array-complex128": "^0.1.0",
50-
"@stdlib/array-complex64": "^0.1.0",
51-
"@stdlib/array-float32": "^0.2.0",
52-
"@stdlib/array-float64": "^0.2.0",
53-
"@stdlib/array-int16": "^0.2.0",
54-
"@stdlib/array-int32": "^0.2.0",
55-
"@stdlib/array-int8": "^0.2.0",
49+
"@stdlib/array-complex128": "^0.2.0",
50+
"@stdlib/array-complex64": "^0.2.0",
51+
"@stdlib/array-float32": "^0.2.1",
52+
"@stdlib/array-float64": "^0.2.1",
53+
"@stdlib/array-int16": "^0.2.1",
54+
"@stdlib/array-int32": "^0.2.1",
55+
"@stdlib/array-int8": "^0.2.1",
5656
"@stdlib/array-typed-real-dtypes": "^0.2.0",
57-
"@stdlib/array-uint16": "^0.2.0",
58-
"@stdlib/array-uint32": "^0.2.0",
59-
"@stdlib/array-uint8": "^0.2.0",
60-
"@stdlib/array-uint8c": "^0.2.0",
61-
"@stdlib/assert-instance-of": "^0.2.0",
62-
"@stdlib/assert-is-array": "^0.2.0",
57+
"@stdlib/array-uint16": "^0.2.1",
58+
"@stdlib/array-uint32": "^0.2.1",
59+
"@stdlib/array-uint8": "^0.2.1",
60+
"@stdlib/array-uint8c": "^0.2.1",
61+
"@stdlib/assert-instance-of": "^0.2.1",
62+
"@stdlib/assert-is-array": "^0.2.1",
6363
"@stdlib/assert-is-typed-array": "^0.2.0",
6464
"@stdlib/assert-is-typed-array-like": "^0.2.0",
6565
"@stdlib/complex-float32": "^0.2.0",
6666
"@stdlib/complex-float64": "^0.2.0",
6767
"@stdlib/math-base-special-pow": "^0.2.0",
68-
"@stdlib/strided-base-reinterpret-complex128": "^0.2.0",
68+
"@stdlib/strided-base-reinterpret-complex128": "^0.2.1",
6969
"@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
7070
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
7171
"istanbul": "^0.4.1",

0 commit comments

Comments
 (0)
0