diff --git a/lib/node_modules/@stdlib/ndarray/defaults/README.md b/lib/node_modules/@stdlib/ndarray/defaults/README.md index 690419c3a3fd..f3ce80d3ece3 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/README.md +++ b/lib/node_modules/@stdlib/ndarray/defaults/README.md @@ -2,7 +2,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. @@ -62,6 +62,7 @@ The returned object has the following properties: - **integer**: default integer data type. - **signed_integer**: default signed integer data type. - **unsigned_integer**: default unsigned integer data type. + - **boolean**: default boolean data type. - **order**: default memory layout. @@ -139,6 +140,10 @@ console.log( x.dtype ); opts.dtype = o.dtypes.unsigned_integer; x = array( buf, opts ); console.log( x.dtype ); + +opts.dtype = o.dtypes.boolean; +x = array( buf, opts ); +console.log( x.dtype ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/defaults/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/defaults/docs/repl.txt index 713f036dbe97..1c9922182323 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/defaults/docs/repl.txt @@ -37,6 +37,9 @@ out.dtypes.unsigned_integer: string Default unsigned integer data type. + out.dtypes.boolean: string + Default boolean data type. + out.order: string Default memory layout. diff --git a/lib/node_modules/@stdlib/ndarray/defaults/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/defaults/docs/types/index.d.ts index ccdea06854f2..7fae9939a06e 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/defaults/docs/types/index.d.ts @@ -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. @@ -66,6 +66,11 @@ interface DataTypes { * Default unsigned integer data type. */ unsigned_integer: 'uint32'; + + /** + * Default boolean value data type. + */ + boolean: 'bool'; } /** diff --git a/lib/node_modules/@stdlib/ndarray/defaults/examples/index.js b/lib/node_modules/@stdlib/ndarray/defaults/examples/index.js index 749a7900b891..993d5a6812e4 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/examples/index.js +++ b/lib/node_modules/@stdlib/ndarray/defaults/examples/index.js @@ -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. @@ -53,3 +53,7 @@ console.log( x.dtype ); opts.dtype = o.dtypes.unsigned_integer; x = array( buf, opts ); console.log( x.dtype ); + +opts.dtype = o.dtypes.boolean; +x = array( buf, opts ); +console.log( x.dtype ); diff --git a/lib/node_modules/@stdlib/ndarray/defaults/lib/get.js b/lib/node_modules/@stdlib/ndarray/defaults/lib/get.js index 7e049b7fddbf..58694385f4cf 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/lib/get.js +++ b/lib/node_modules/@stdlib/ndarray/defaults/lib/get.js @@ -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. @@ -36,6 +36,7 @@ var HASH = { 'dtypes.integer': DEFAULTS.dtypes.integer, 'dtypes.signed_integer': DEFAULTS.dtypes.signed_integer, 'dtypes.unsigned_integer': DEFAULTS.dtypes.unsigned_integer, + 'dtypes.boolean': DEFAULTS.dtypes.boolean, 'order': DEFAULTS.order, 'casting': DEFAULTS.casting, 'index_mode': DEFAULTS.index_mode diff --git a/lib/node_modules/@stdlib/ndarray/defaults/lib/main.js b/lib/node_modules/@stdlib/ndarray/defaults/lib/main.js index ae48c8737316..138037dda845 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/defaults/lib/main.js @@ -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. @@ -41,7 +41,8 @@ function defaults() { 'complex_floating_point': 'complex128', 'integer': 'int32', 'signed_integer': 'int32', - 'unsigned_integer': 'uint32' + 'unsigned_integer': 'uint32', + 'boolean': 'bool' }, // Memory layout: diff --git a/lib/node_modules/@stdlib/ndarray/defaults/test/test.get.js b/lib/node_modules/@stdlib/ndarray/defaults/test/test.get.js index ad46f7395058..16b995d1cb44 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/test/test.get.js +++ b/lib/node_modules/@stdlib/ndarray/defaults/test/test.get.js @@ -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. @@ -54,6 +54,7 @@ tape( 'if provided a recognized setting, the function returns a default value', 'dtypes.integer', 'dtypes.signed_integer', 'dtypes.unsigned_integer', + 'dtypes.boolean', 'casting', 'order', @@ -69,6 +70,7 @@ tape( 'if provided a recognized setting, the function returns a default value', DEFAULTS.dtypes.integer, DEFAULTS.dtypes.signed_integer, DEFAULTS.dtypes.unsigned_integer, + DEFAULTS.dtypes.boolean, DEFAULTS.casting, DEFAULTS.order, diff --git a/lib/node_modules/@stdlib/ndarray/defaults/test/test.main.js b/lib/node_modules/@stdlib/ndarray/defaults/test/test.main.js index a597fa8d160c..f3a34c1fbc30 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/test/test.main.js +++ b/lib/node_modules/@stdlib/ndarray/defaults/test/test.main.js @@ -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. @@ -66,6 +66,9 @@ tape( 'the function returns default ndarray settings', function test( t ) { t.strictEqual( hasOwnProp( o.dtypes, 'unsigned_integer' ), true, 'has property' ); t.strictEqual( typeof o.dtypes.unsigned_integer, '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, 'order' ), true, 'has property' ); t.strictEqual( typeof o.order, 'string', 'returns expected value' );