Skip to content

feat: add boolean datatype support in array/defaults #2309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/node_modules/@stdlib/array/defaults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ The returned object has the following properties:
- **floating_point**: default floating-point data type.
- **real_floating_point**: default real-valued floating-point data type.
- **complex_floating_point**: default complex-valued floating-point data type.
- **boolean**: default boolean data type.
- **integer**: default integer data type.
- **signed_integer**: default signed integer data type.
- **unsigned_integer**: default unsigned integer data type.
Expand Down
3 changes: 3 additions & 0 deletions lib/node_modules/@stdlib/array/defaults/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
out.dtypes.complex_floating_point: string
Default complex-valued floating-point data type.

out.dtypes.boolean: string
Default boolean data type.

out.dtypes.integer: string
Default integer data type.

Expand Down
5 changes: 5 additions & 0 deletions lib/node_modules/@stdlib/array/defaults/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
*/
complex_floating_point: 'complex128';

/**
* Default boolean data type.
*/
boolean: 'bool';

/**
* Default integer data type.
*/
Expand Down Expand Up @@ -103,7 +108,7 @@
* var v = defaults.get( 'dtypes.default' );
* // returns <string>
*/
get( name: string ): any;

Check warning on line 111 in lib/node_modules/@stdlib/array/defaults/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/node_modules/@stdlib/array/defaults/lib/get.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2023 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,6 +33,7 @@ var HASH = {
'dtypes.floating_point': DEFAULTS.dtypes.floating_point,
'dtypes.real_floating_point': DEFAULTS.dtypes.real_floating_point,
'dtypes.complex_floating_point': DEFAULTS.dtypes.complex_floating_point,
'dtypes.boolean': DEFAULTS.dtypes.boolean,
'dtypes.integer': DEFAULTS.dtypes.integer,
'dtypes.signed_integer': DEFAULTS.dtypes.signed_integer,
'dtypes.unsigned_integer': DEFAULTS.dtypes.unsigned_integer
Expand Down
3 changes: 2 additions & 1 deletion lib/node_modules/@stdlib/array/defaults/lib/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2023 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,6 +39,7 @@ function defaults() {
'floating_point': 'float64',
'real_floating_point': 'float64',
'complex_floating_point': 'complex128',
'boolean': 'bool',
'integer': 'int32',
'signed_integer': 'int32',
'unsigned_integer': 'uint32'
Expand Down
4 changes: 3 additions & 1 deletion lib/node_modules/@stdlib/array/defaults/test/test.get.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2023 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,6 +51,7 @@ tape( 'if provided a recognized setting, the function returns a default value',
'dtypes.floating_point',
'dtypes.real_floating_point',
'dtypes.complex_floating_point',
'dtypes.boolean',
'dtypes.integer',
'dtypes.signed_integer',
'dtypes.unsigned_integer'
Expand All @@ -62,6 +63,7 @@ tape( 'if provided a recognized setting, the function returns a default value',
DEFAULTS.dtypes.floating_point,
DEFAULTS.dtypes.real_floating_point,
DEFAULTS.dtypes.complex_floating_point,
DEFAULTS.dtypes.boolean,
DEFAULTS.dtypes.integer,
DEFAULTS.dtypes.signed_integer,
DEFAULTS.dtypes.unsigned_integer
Expand Down
3 changes: 3 additions & 0 deletions lib/node_modules/@stdlib/array/defaults/test/test.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ tape( 'the function returns default settings', function test( t ) {
t.strictEqual( hasOwnProp( o.dtypes, 'complex_floating_point' ), true, 'has property' );
t.strictEqual( typeof o.dtypes.complex_floating_point, 'string', 'returns expected value' );

t.strictEqual( hasOwnProp( o.dtypes, 'boolean' ), true, 'has property' );
t.strictEqual( typeof o.dtypes.boolean, 'string', 'returns expected value' );

t.strictEqual( hasOwnProp( o.dtypes, 'integer' ), true, 'has property' );
t.strictEqual( typeof o.dtypes.integer, 'string', 'returns expected value' );

Expand Down
Loading