|
| 1 | +<!-- |
| 2 | +
|
| 3 | +@license Apache-2.0 |
| 4 | +
|
| 5 | +Copyright (c) 2024 The Stdlib Authors. |
| 6 | +
|
| 7 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +you may not use this file except in compliance with the License. |
| 9 | +You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | +Unless required by applicable law or agreed to in writing, software |
| 14 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +See the License for the specific language governing permissions and |
| 17 | +limitations under the License. |
| 18 | +
|
| 19 | +--> |
| 20 | + |
| 21 | +# isBooleanDataType |
| 22 | + |
| 23 | +> Test if an input value is a supported array boolean data type. |
| 24 | +
|
| 25 | +<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> |
| 26 | + |
| 27 | +<section class="intro"> |
| 28 | + |
| 29 | +</section> |
| 30 | + |
| 31 | +<!-- /.intro --> |
| 32 | + |
| 33 | +<!-- Package usage documentation. --> |
| 34 | + |
| 35 | +<section class="usage"> |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +```javascript |
| 40 | +var isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' ); |
| 41 | +``` |
| 42 | + |
| 43 | +#### isBooleanDataType( value ) |
| 44 | + |
| 45 | +Tests if an input `value` is a supported array boolean data type. |
| 46 | + |
| 47 | +```javascript |
| 48 | +var bool = isBooleanDataType( 'bool' ); |
| 49 | +// returns true |
| 50 | + |
| 51 | +bool = isBooleanDataType( 'uint32' ); |
| 52 | +// returns false |
| 53 | +``` |
| 54 | + |
| 55 | +</section> |
| 56 | + |
| 57 | +<!-- /.usage --> |
| 58 | + |
| 59 | +<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 60 | + |
| 61 | +<section class="notes"> |
| 62 | + |
| 63 | +</section> |
| 64 | + |
| 65 | +<!-- /.notes --> |
| 66 | + |
| 67 | +<!-- Package usage examples. --> |
| 68 | + |
| 69 | +<section class="examples"> |
| 70 | + |
| 71 | +## Examples |
| 72 | + |
| 73 | +<!-- eslint no-undef: "error" --> |
| 74 | + |
| 75 | +```javascript |
| 76 | +var isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' ); |
| 77 | + |
| 78 | +var bool = isBooleanDataType( 'bool' ); |
| 79 | +// returns true |
| 80 | + |
| 81 | +bool = isBooleanDataType( 'complex64' ); |
| 82 | +// returns false |
| 83 | + |
| 84 | +bool = isBooleanDataType( 'complex128' ); |
| 85 | +// returns false |
| 86 | + |
| 87 | +bool = isBooleanDataType( 'float32' ); |
| 88 | +// returns false |
| 89 | + |
| 90 | +bool = isBooleanDataType( 'float64' ); |
| 91 | +// returns false |
| 92 | + |
| 93 | +bool = isBooleanDataType( 'generic' ); |
| 94 | +// returns false |
| 95 | + |
| 96 | +bool = isBooleanDataType( 'int16' ); |
| 97 | +// returns false |
| 98 | + |
| 99 | +bool = isBooleanDataType( 'int32' ); |
| 100 | +// returns false |
| 101 | + |
| 102 | +bool = isBooleanDataType( 'int8' ); |
| 103 | +// returns false |
| 104 | + |
| 105 | +bool = isBooleanDataType( 'uint16' ); |
| 106 | +// returns false |
| 107 | + |
| 108 | +bool = isBooleanDataType( 'uint32' ); |
| 109 | +// returns false |
| 110 | + |
| 111 | +bool = isBooleanDataType( 'uint8' ); |
| 112 | +// returns false |
| 113 | + |
| 114 | +bool = isBooleanDataType( 'uint8c' ); |
| 115 | +// returns false |
| 116 | + |
| 117 | +bool = isBooleanDataType( '' ); |
| 118 | +// returns false |
| 119 | + |
| 120 | +bool = isBooleanDataType( 'foo' ); |
| 121 | +// returns false |
| 122 | +``` |
| 123 | + |
| 124 | +</section> |
| 125 | + |
| 126 | +<!-- /.examples --> |
| 127 | + |
| 128 | +<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 129 | + |
| 130 | +<section class="references"> |
| 131 | + |
| 132 | +</section> |
| 133 | + |
| 134 | +<!-- /.references --> |
| 135 | + |
| 136 | +<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> |
| 137 | + |
| 138 | +<section class="related"> |
| 139 | + |
| 140 | +</section> |
| 141 | + |
| 142 | +<!-- /.related --> |
| 143 | + |
| 144 | +<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 145 | + |
| 146 | +<section class="links"> |
| 147 | + |
| 148 | +</section> |
| 149 | + |
| 150 | +<!-- /.links --> |
0 commit comments