File tree 6 files changed +26
-5
lines changed
lib/node_modules/@stdlib/array/ctors
6 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
@license Apache-2.0
4
4
5
- Copyright (c) 2018 The Stdlib Authors.
5
+ Copyright (c) 2024 The Stdlib Authors.
6
6
7
7
Licensed under the Apache License, Version 2.0 (the "License");
8
8
you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@ The function returns constructors for the following data types:
55
55
- ` float64 ` : double-precision floating-point numbers.
56
56
- ` complex64 ` : single-precision complex floating-point numbers.
57
57
- ` complex128 ` : double-precision complex floating-point numbers.
58
+ - ` bool ` : boolean values.
58
59
- ` generic ` : values of any type.
59
60
- ` int16 ` : signed 16-bit integers.
60
61
- ` int32 ` : signed 32-bit integers.
Original file line number Diff line number Diff line change 8
8
- float64: double-precision floating-point numbers.
9
9
- complex64: single-precision complex floating-point numbers.
10
10
- complex128: double-precision complex floating-point numbers.
11
+ - bool: boolean values.
11
12
- generic: values of any type.
12
13
- int16: signed 16-bit integers.
13
14
- int32: signed 32-bit integers.
Original file line number Diff line number Diff line change 20
20
21
21
import Complex128Array = require( '@stdlib/array/complex128' ) ;
22
22
import Complex64Array = require( '@stdlib/array/complex64' ) ;
23
+ import BooleanArray = require( '@stdlib/array/bool' ) ;
23
24
24
25
/**
25
26
* Returns a `Float64Array` constructor.
@@ -69,6 +70,18 @@ declare function ctors( dtype: 'complex128' ): typeof Complex128Array;
69
70
*/
70
71
declare function ctors ( dtype : 'complex64' ) : typeof Complex64Array ;
71
72
73
+ /**
74
+ * Returns a `BooleanArray` constructor.
75
+ *
76
+ * @param dtype - data type
77
+ * @returns constructor
78
+ *
79
+ * @example
80
+ * var ctor = ctors( 'bool' );
81
+ * // returns <Function>
82
+ */
83
+ declare function ctors ( dtype : 'bool' ) : typeof BooleanArray ;
84
+
72
85
/**
73
86
* Returns an `Int32Array` constructor.
74
87
*
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import ctors = require( './index' );
27
27
ctors ( 'float32' ) ; // $ExpectType Float32ArrayConstructor
28
28
ctors ( 'complex128' ) ; // $ExpectType Complex128ArrayConstructor
29
29
ctors ( 'complex64' ) ; // $ExpectType Complex64ArrayConstructor
30
+ ctors ( 'bool' ) ; // $ExpectType BooleanArrayConstructor
30
31
ctors ( 'int32' ) ; // $ExpectType Int32ArrayConstructor
31
32
ctors ( 'int16' ) ; // $ExpectType Int16ArrayConstructor
32
33
ctors ( 'int8' ) ; // $ExpectType Int8ArrayConstructor
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ var Uint8Array = require( '@stdlib/array/uint8' );
31
31
var Uint8ClampedArray = require ( '@stdlib/array/uint8c' ) ;
32
32
var Complex64Array = require ( '@stdlib/array/complex64' ) ;
33
33
var Complex128Array = require ( '@stdlib/array/complex128' ) ;
34
+ var BooleanArray = require ( '@stdlib/array/bool' ) ;
34
35
35
36
36
37
// MAIN //
@@ -48,7 +49,8 @@ var ctors = {
48
49
'uint8' : Uint8Array ,
49
50
'uint8c' : Uint8ClampedArray ,
50
51
'complex64' : Complex64Array ,
51
- 'complex128' : Complex128Array
52
+ 'complex128' : Complex128Array ,
53
+ 'bool' : BooleanArray
52
54
} ;
53
55
54
56
Original file line number Diff line number Diff line change 1
1
/**
2
2
* @license Apache-2.0
3
3
*
4
- * Copyright (c) 2018 The Stdlib Authors.
4
+ * Copyright (c) 2024 The Stdlib Authors.
5
5
*
6
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
7
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ var Uint8Array = require( '@stdlib/array/uint8' );
33
33
var Uint8ClampedArray = require ( '@stdlib/array/uint8c' ) ;
34
34
var Complex64Array = require ( '@stdlib/array/complex64' ) ;
35
35
var Complex128Array = require ( '@stdlib/array/complex128' ) ;
36
+ var BooleanArray = require ( '@stdlib/array/bool' ) ;
36
37
var isFunction = require ( '@stdlib/assert/is-function' ) ;
37
38
var ctors = require ( './../lib' ) ;
38
39
@@ -63,7 +64,8 @@ tape( 'the function returns array constructors', function test( t ) {
63
64
'uint8' ,
64
65
'uint8c' ,
65
66
'complex64' ,
66
- 'complex128'
67
+ 'complex128' ,
68
+ 'bool'
67
69
] ;
68
70
expected = [
69
71
Float64Array ,
@@ -77,7 +79,8 @@ tape( 'the function returns array constructors', function test( t ) {
77
79
Uint8Array ,
78
80
Uint8ClampedArray ,
79
81
Complex64Array ,
80
- Complex128Array
82
+ Complex128Array ,
83
+ BooleanArray
81
84
] ;
82
85
for ( i = 0 ; i < dtypes . length ; i ++ ) {
83
86
ctor = ctors ( dtypes [ i ] ) ;
You can’t perform that action at this time.
0 commit comments