diff --git a/lib/node_modules/@stdlib/strided/dtypes/README.md b/lib/node_modules/@stdlib/strided/dtypes/README.md index e20e8943e226..ee9a857d4e2c 100644 --- a/lib/node_modules/@stdlib/strided/dtypes/README.md +++ b/lib/node_modules/@stdlib/strided/dtypes/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2020 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. @@ -46,12 +46,13 @@ Returns a list of strided array data types. ```javascript var out = dtypes(); -// returns [ 'binary', 'complex64', 'complex128', 'float32', 'float64', 'generic', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c' ] +// e.g., returns [ 'binary', 'bool', 'complex64', ... ] ``` -The output `array` contains the following data types: +The output array contains the following data types: - `binary`: binary. +- `bool`: boolean values. - `complex64`: single-precision complex floating-point numbers. - `complex128`: double-precision complex floating-point numbers. - `float32`: single-precision floating-point numbers. @@ -86,17 +87,12 @@ The output `array` contains the following data types: ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var dtypes = require( '@stdlib/strided/dtypes' ); -var DTYPES = dtypes(); -var bool; +var isdtype = contains( dtypes() ); -function isdtype( str ) { - return ( indexOf( DTYPES, str ) >= 0 ); -} - -bool = isdtype( 'float64' ); +var bool = isdtype( 'float64' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/strided/dtypes/docs/repl.txt b/lib/node_modules/@stdlib/strided/dtypes/docs/repl.txt index 73e140056ef5..3b9bda333d93 100644 --- a/lib/node_modules/@stdlib/strided/dtypes/docs/repl.txt +++ b/lib/node_modules/@stdlib/strided/dtypes/docs/repl.txt @@ -5,6 +5,7 @@ The output array contains the following data types: - binary: binary. + - bool: boolean values. - complex64: single-precision complex floating-point numbers. - complex128: double-precision complex floating-point numbers. - float32: single-precision floating-point numbers. diff --git a/lib/node_modules/@stdlib/strided/dtypes/examples/index.js b/lib/node_modules/@stdlib/strided/dtypes/examples/index.js index c76049b8c406..04e186a5afeb 100644 --- a/lib/node_modules/@stdlib/strided/dtypes/examples/index.js +++ b/lib/node_modules/@stdlib/strided/dtypes/examples/index.js @@ -18,17 +18,12 @@ 'use strict'; -var indexOf = require( '@stdlib/utils/index-of' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var dtypes = require( './../lib' ); -var DTYPES = dtypes(); -var bool; +var isdtype = contains( dtypes() ); -function isdtype( str ) { - return ( indexOf( DTYPES, str ) >= 0 ); -} - -bool = isdtype( 'float64' ); +var bool = isdtype( 'float64' ); console.log( bool ); // => true diff --git a/lib/node_modules/@stdlib/strided/dtypes/lib/dtypes.json b/lib/node_modules/@stdlib/strided/dtypes/lib/dtypes.json index f8fdc158ca1d..4539ab6da0e9 100644 --- a/lib/node_modules/@stdlib/strided/dtypes/lib/dtypes.json +++ b/lib/node_modules/@stdlib/strided/dtypes/lib/dtypes.json @@ -1,5 +1,6 @@ [ - "binary", + "binary", + "bool", "complex64", "complex128", "float32", diff --git a/lib/node_modules/@stdlib/strided/dtypes/test/test.js b/lib/node_modules/@stdlib/strided/dtypes/test/test.js index 550b466d876b..c1058c33114f 100644 --- a/lib/node_modules/@stdlib/strided/dtypes/test/test.js +++ b/lib/node_modules/@stdlib/strided/dtypes/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 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. @@ -43,7 +43,9 @@ var DTYPES = [ 'float64', 'complex64', - 'complex128' + 'complex128', + + 'bool' ]; @@ -61,6 +63,7 @@ tape( 'the function returns a list of strided array data type strings', function expected = [ 'binary', + 'bool', 'complex64', 'complex128', 'float32',