8000 Auto-generated commit · stdlib-js/array-typed@6d03d29 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d03d29

Browse files
committed
Auto-generated commit
1 parent 41b8736 commit 6d03d29

File tree

7 files changed

+39
-45
lines changed

7 files changed

+39
-45
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
@@ -283,8 +283,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
283283
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-typed.svg
284284
[npm-url]: https://npmjs.org/package/@stdlib/array-typed
285285

286-
[test-image]: https://github.com/stdlib-js/array-typed/actions/workflows/test.yml/badge.svg?branch=v0.2.0
287-
[test-url]: https://github.com/stdlib-js/array-typed/actions/workflows/test.yml?query=branch:v0.2.0
286+
[test-image]: https://github.com/stdlib-js/array-typed/actions/workflows/test.yml/badge.svg?branch=main
287+
[test-url]: https://github.com/stdlib-js/array-typed/actions/workflows/test.yml?query=branch:main
288288

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

docs/types/index.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/// <reference types="@stdlib/types"/>
2424

25-
import { ArrayLike, RealOrComplexTypedArray, NumericDataType } from '@stdlib/types/array';
25+
import { RealOrComplexTypedArray, TypedDataTypeMap } from '@stdlib/types/array';
2626
import ArrayBuffer = require( '@stdlib/array-buffer' );
2727

2828
/**
@@ -39,7 +39,7 @@ import ArrayBuffer = require( '@stdlib/array-buffer' );
3939
* var arr = typedarray( 'float32');
4040
* // returns <Float32Array>
4141
*/
42-
declare function typedarray( dtype?: NumericDataType ): RealOrComplexTypedArray;
42+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( dtype?: T ): TypedDataTypeMap[T];
4343

4444
/**
4545
* Creates a typed array.
@@ -56,7 +56,7 @@ declare function typedarray( dtype?: NumericDataType ): RealOrComplexTypedArray;
5656
* var arr = typedarray( 2, 'float32' );
5757
* // returns <Float32Array>[ 0.0, 0.0 ]
5858
*/
59-
declare function typedarray( length: number, dtype?: NumericDataType ): RealOrComplexTypedArray;
59+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( length: number, dtype?: T ): TypedDataTypeMap[T];
6060

6161
/**
6262
* Creates a typed array.
@@ -83,7 +83,7 @@ declare function typedarray( length: number, dtype?: NumericDataType ): RealOrCo
8383
* var arr2 = typedarray( arr1, 'uint32' );
8484
* // returns <Uint32Array>[ 5, 3 ]
8585
*/
86-
declare function typedarray( typedarray: RealOrComplexTypedArray, dtype?: NumericDataType ): RealOrComplexTypedArray;
86+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( typedarray: RealOrComplexTypedArray, dtype?: T ): TypedDataTypeMap[T];
8787

8888
/**
8989
* Creates a typed array.
@@ -100,7 +100,7 @@ declare function typedarray( typedarray: RealOrComplexTypedArray, dtype?: Numeri
100100
* var arr = typedarray( [ 5, -3 ], 'int32' );
101101
* // returns <Int32Array>[ 5, -3 ]
102102
*/
103-
declare function typedarray( obj: ArrayLike<number> | Iterable<any>, dtype?: NumericDataType ): RealOrComplexTypedArray;
103+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( obj: ArrayLike<number> | Iterable<any>, dtype?: T ): TypedDataTypeMap[T];
104104

105105
/**
106106
* Creates a typed array.
@@ -123,7 +123,7 @@ declare function typedarray( obj: ArrayLike<number> | Iterable<any>, dtype?: Num
123123
* var arr = typedarray( buf, 'float32' );
124124
* // returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]
125125
*/
126-
declare function typedarray( buffer: ArrayBuffer, dtype?: NumericDataType ): RealOrComplexTypedArray;
126+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( buffer: ArrayBuffer, dtype?: T ): TypedDataTypeMap[T];
127127

128128
/**
129129
* Creates a typed array.
@@ -147,7 +147,7 @@ declare function typedarray( buffer: ArrayBuffer, dtype?: NumericDataType ): Rea
147147
* var arr = typedarray( buf, 8, 'float32' );
148148
* // returns <Float32Array>[ 0.0, 0.0 ]
149149
*/
150-
declare function typedarray( buffer: ArrayBuffer, byteOffset?: number, dtype?: NumericDataType ): RealOrComplexTypedArray;
150+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( buffer: ArrayBuffer, byteOffset?: number, dtype?: T ): TypedDataTypeMap[T];
151151

152152
/**
153153
* Creates a typed array.
@@ -172,7 +172,7 @@ declare function typedarray( buffer: ArrayBuffer, byteOffset?: number, dtype?: N
172172
* var arr = typedarray( buf, 8, 2, 'int32' );
173173
* // returns <Int32Array>[ 0, 0 ]
174174
*/
175-
declare function typedarray( buffer: ArrayBuffer, byteOffset?: number, length?: number, dtype?: NumericDataType ): RealOrComplexTypedArray;
175+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( buffer: ArrayBuffer, byteOffset?: number, length?: number, dtype?: T ): TypedDataTypeMap[T];
176176

177177

178178
// EXPORTS //

docs/types/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import typedarray = require( './index' );
2323

2424
// The function returns a typed array..
2525
{
26-
typedarray(); // $ExpectType RealOrComplexTypedArray
27-
typedarray( 'float32' ); // $ExpectType RealOrComplexTypedArray
28-
typedarray( 10, 'float32' ); // $ExpectType RealOrComplexTypedArray
29-
typedarray( [ 1, 2, 3 ], 'int32' ); // $ExpectType RealOrComplexTypedArray
26+
typedarray(); // $ExpectType Float64Array
27+
typedarray( 'float32' ); // $ExpectType Float32Array
28+
typedarray( 10, 'float32' ); // $ExpectType Float32Array
29+
typedarray( [ 1, 2, 3 ], 'int32' ); // $ExpectType Int32Array
3030
}
3131

3232
// The compiler throws an error if the function is provided a first argument which is not a data type, number, array-like object, or typed array...

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,30 @@
3939
"dependencies": {
4040
"@stdlib/array-defaults": "^0.2.0",
4141
"@stdlib/array-typed-ctors": "^0.2.0",
42-
"@stdlib/assert-is-string": "^0.2.0",
43-
"@stdlib/strided-base-reinterpret-complex128": "^0.2.0",
42+
"@stdlib/assert-is-string": "^0.2.1",
43+
"@stdlib/strided-base-reinterpret-complex128": "^0.2.1",
4444
"@stdlib/strided-base-reinterpret-complex64": "^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": {
4949
"@stdlib/array-buffer": "^0.2.0",
50-
"@stdlib/array-complex128": "^0.1.0",
51-
"@stdlib/array-complex64": "^0.1.0",
52-
"@stdlib/array-float32": "^0.2.0",
53-
"@stdlib/array-float64": "^0.2.0",
54-
"@stdlib/array-int16": "^0.2.0",
55-
"@stdlib/array-int32": "^0.2.0",
56-
"@stdlib/array-int8": "^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",
50+
"@stdlib/array-complex128": "^0.2.0",
51+
"@stdlib/array-complex64": "^0.2.0",
52+
"@stdlib/array-float32": "^0.2.1",
53+
"@stdlib/array-float64": "^0.2.1",
54+
"@stdlib/array-int16": "^0.2.1",
55+
"@stdlib/array-int32": "^0.2.1",
56+
"@stdlib/array-int8": "^0.2.1",
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",
6262
"@stdlib/assert-is-complex-typed-array": "^0.2.0",
6363
"@stdlib/assert-is-typed-array": "^0.2.0",
6464
"@stdlib/math-base-special-pow": "^0.2.0",
65-
"@stdlib/random-base-randu": "^0.1.0",
65+
"@stdlib/random-base-randu": "^0.2.0",
6666
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
6767
"istanbul": "^0.4.1",
6868
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",

0 commit comments

Comments
 (0)
0