Skip to content

Commit a230e27

Browse files
Jaysukh-409kgryte
authored andcommitted
feat: add boolean dtype support in array/defaults
PR-URL: stdlib-js#2309 Ref: stdlib-js#2304 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]>
1 parent d067d17 commit a230e27

File tree

7 files changed

+19
-3
lines changed

7 files changed

+19
-3
lines changed

lib/node_modules/@stdlib/array/defaults/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The returned object has the following properties:
5959
- **floating_point**: default floating-point data type.
6060
- **real_floating_point**: default real-valued floating-point data type.
6161
- **complex_floating_point**: default complex-valued floating-point data type.
62+
- **boolean**: default boolean data type.
6263
- **integer**: default integer data type.
6364
- **signed_integer**: default signed integer data type.
6465
- **unsigned_integer**: default unsigned integer data type.

lib/node_modules/@stdlib/array/defaults/docs/repl.txt

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
out.dtypes.complex_floating_point: string
2929
Default complex-valued floating-point data type.
3030

31+
out.dtypes.boolean: string
32+
Default boolean data type.
33+
3134
out.dtypes.integer: string
3235
Default integer data type.
3336

lib/node_modules/@stdlib/array/defaults/docs/types/index.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ interface DataTypes {
5252
*/
5353
complex_floating_point: 'complex128';
5454

55+
/**
56+
* Default boolean data type.
57+
*/
58+
boolean: 'bool';
59+
5560
/**
5661
* Default integer data type.
5762
*/

lib/node_modules/@stdlib/array/defaults/lib/get.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ var HASH = {
3333
'dtypes.floating_point': DEFAULTS.dtypes.floating_point,
3434
'dtypes.real_floating_point': DEFAULTS.dtypes.real_floating_point,
3535
'dtypes.complex_floating_point': DEFAULTS.dtypes.complex_floating_point,
36+
'dtypes.boolean': DEFAULTS.dtypes.boolean,
3637
'dtypes.integer': DEFAULTS.dtypes.integer,
3738
'dtypes.signed_integer': DEFAULTS.dtypes.signed_integer,
3839
'dtypes.unsigned_integer': DEFAULTS.dtypes.unsigned_integer

lib/node_modules/@stdlib/array/defaults/lib/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ function defaults() {
3939
'floating_point': 'float64',
4040
'real_floating_point': 'float64',
4141
'complex_floating_point': 'complex128',
42+
'boolean': 'bool',
4243
'integer': 'int32',
4344
'signed_integer': 'int32',
4445
'unsigned_integer': 'uint32'

lib/node_modules/@stdlib/array/defaults/test/test.get.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -51,6 +51,7 @@ tape( 'if provided a recognized setting, the function returns a default value',
5151
'dtypes.floating_point',
5252
'dtypes.real_floating_point',
5353
'dtypes.complex_floating_point',
54+
'dtypes.boolean',
5455
'dtypes.integer',
5556
'dtypes.signed_integer',
5657
'dtypes.unsigned_integer'
@@ -62,6 +63,7 @@ tape( 'if provided a recognized setting, the function returns a default value',
6263
DEFAULTS.dtypes.floating_point,
6364
DEFAULTS.dtypes.real_floating_point,
6465
DEFAULTS.dtypes.complex_floating_point,
66+
DEFAULTS.dtypes.boolean,
6567
DEFAULTS.dtypes.integer,
6668
DEFAULTS.dtypes.signed_integer,
6769
DEFAULTS.dtypes.unsigned_integer

lib/node_modules/@stdlib/array/defaults/test/test.main.js

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ tape( 'the function returns default settings', function test( t ) {
5757
t.strictEqual( hasOwnProp( o.dtypes, 'complex_floating_point' ), true, 'has property' );
5858
t.strictEqual( typeof o.dtypes.complex_floating_point, 'string', 'returns expected value' );
5959

60+
t.strictEqual( hasOwnProp( o.dtypes, 'boolean' ), true, 'has property' );
61+
t.strictEqual( typeof o.dtypes.boolean, 'string', 'returns expected value' );
62+
6063
t.strictEqual( hasOwnProp( o.dtypes, 'integer' ), true, 'has property' );
6164
t.strictEqual( typeof o.dtypes.integer, 'string', 'returns expected value' );
6265

0 commit comments

Comments
 (0)