File tree 3 files changed +21
-2
lines changed
lib/node_modules/@stdlib/array/next-dtype
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
* @license Apache-2.0
3
3
*
4
- * Copyright (c) 2021 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.
@@ -192,6 +192,22 @@ declare function nextDataType( dtype: 'uint8c' ): 'uint16'; // eslint-disable-li
192
192
*/
193
193
declare function nextDataType ( dtype : 'generic' ) : number ; // eslint-disable-line @typescript-eslint/unified-signatures
194
194
195
+ /**
196
+ * Returns the next larger array data type of the same kind.
197
+ *
198
+ * ## Notes
199
+ *
200
+ * - If a data type does not have a next larger data type or the next larger type is not supported, the function returns `-1`.
201
+ *
202
+ * @param dtype - array data type
203
+ * @returns next larger data type
204
+ *
205
+ * @example
206
+ * var dt = nextDataType( 'bool' );
207
+ * // returns -1
208
+ */
209
+ declare function nextDataType ( dtype : 'bool' ) : number ; // eslint-disable-line @typescript-eslint/unified-signatures
210
+
195
211
/**
196
212
* Returns the next larger array data type of the same kind.
197
213
*
Original file line number Diff line number Diff line change 1
1
/*
2
2
* @license Apache-2.0
3
3
*
4
- * Copyright (c) 2021 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.
@@ -31,6 +31,8 @@ import nextDataType = require( './index' );
31
31
nextDataType ( 'complex128' ) ; // $ExpectType number
32
32
nextDataType ( 'complex64' ) ; // $ExpectType "complex128"
33
33
34
+ nextDataType ( 'bool' ) ; // $ExpectType number
35
+
34
36
nextDataType ( 'float64' ) ; // $ExpectType number
35
37
nextDataType ( 'float32' ) ; // $ExpectType "float64"
36
38
Original file line number Diff line number Diff line change 9
9
"uint8" : " uint16" ,
10
10
"uint8c" : " uint16" ,
11
11
"generic" : -1 ,
12
+ "bool" : -1 ,
12
13
"complex64" : " complex128" ,
13
14
"complex128" : -1
14
15
}
You can’t perform that action at this time.
0 commit comments