Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jun 6, 2024
1 parent 0aa2167 commit 71f7e11
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 9 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,28 @@ This release closes the following issue:

<!-- /.package -->

<section class="package" id="array-dtype-unreleased">

#### [@stdlib/array/dtype](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/dtype)

<details>

<section class="features">

##### Features

- [`26681a0`](https://github.com/stdlib-js/stdlib/commit/26681a00adf94037d357eaebf842af2c454b06e3) - add boolean dtype support in `array/dtype` [(#2306)](https://github.com/stdlib-js/stdlib/pull/2306)

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

<section class="package" id="array-dtypes-unreleased">

#### [@stdlib/array/dtypes](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/dtypes)
Expand Down Expand Up @@ -1680,6 +1702,7 @@ A total of 13 people contributed to this release. Thank you to the following con

<details>

- [`26681a0`](https://github.com/stdlib-js/stdlib/commit/26681a00adf94037d357eaebf842af2c454b06e3) - **feat:** add boolean dtype support in `array/dtype` [(#2306)](https://github.com/stdlib-js/stdlib/pull/2306) _(by Jaysukh Makvana, Athan Reines)_
- [`1510858`](https://github.com/stdlib-js/stdlib/commit/1510858faac58b25a8c5e398ffe54545526acfe6) - **feat:** add boolean dtype support in `array/ctors` [(#2308)](https://github.com/stdlib-js/stdlib/pull/2308) _(by Jaysukh Makvana)_
- [`50e2775`](https://github.com/stdlib-js/stdlib/commit/50e2775cfb5128c0e66cdc755ca459ac416c3481) - **feat:** add boolean dtype support in `array/defaults` [(#2309)](https://github.com/stdlib-js/stdlib/pull/2309) _(by Jaysukh Makvana, Athan Reines)_
- [`31f2c1a`](https://github.com/stdlib-js/stdlib/commit/31f2c1a8c77a86aac05815d89f158febe8a37611) - **feat:** add boolean dtype support in `array/mostly-safe-casts` [(#2310)](https://github.com/stdlib-js/stdlib/pull/2310) _(by Jaysukh Makvana, Athan Reines)_
Expand Down
18 changes: 16 additions & 2 deletions dtype/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2021 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 All @@ -20,7 +20,7 @@

/// <reference types="@stdlib/types"/>

import { RealOrComplexTypedArray, Complex128Array, Complex64Array, DataType } from '@stdlib/types/array';
import { RealOrComplexTypedArray, Complex128Array, Complex64Array, BooleanArray, DataType } from '@stdlib/types/array';

/**
* Returns the data type of an array.
Expand Down Expand Up @@ -78,6 +78,20 @@ declare function dtype( value: Complex128Array ): 'complex128';
*/
declare function dtype( value: Complex64Array ): 'complex64';

/**
* Returns the data type of an array.
*
* @param value - input value
* @returns data type
*
* @example
* var BooleanArray = require( '@stdlib/array/bool' );
*
* var dt = dtype( new BooleanArray( [ true, false, true, false ] ) );
* // returns 'bool'
*/
declare function dtype( value: BooleanArray ): 'bool';

/**
* Returns the data type of an array.
*
Expand Down
4 changes: 3 additions & 1 deletion dtype/docs/types/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2021 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 All @@ -18,6 +18,7 @@

import Complex128Array = require( './../../../complex128' );
import Complex64Array = require( './../../../complex64' );
import BooleanArray = require( './../../../bool' );
import dtype = require( './index' );


Expand All @@ -36,6 +37,7 @@ import dtype = require( './index' );
dtype( new Uint16Array( 10 ) ); // $ExpectType "uint16"
dtype( new Uint8Array( 10 ) ); // $ExpectType "uint8"
dtype( new Uint8ClampedArray( 10 ) ); // $ExpectType "uint8c"
dtype( new BooleanArray( 10 ) ); // $ExpectType "bool"
dtype( [] ); // $ExpectType "generic"
}

Expand Down
5 changes: 3 additions & 2 deletions dtype/lib/ctor2dtype.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 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,7 +33,8 @@ var ctor2dtypes = {
'Uint8Array': 'uint8',
'Uint8ClampedArray': 'uint8c',
'Complex64Array': 'complex64',
'Complex128Array': 'complex128'
'Complex128Array': 'complex128',
'BooleanArray': 'bool'
};


Expand Down
6 changes: 4 additions & 2 deletions dtype/lib/ctors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 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 @@ -31,6 +31,7 @@ var Uint8ClampedArray = require( './../../uint8c' );
var Int8Array = require( './../../int8' );
var Complex64Array = require( './../../complex64' );
var Complex128Array = require( './../../complex128' );
var BooleanArray = require( './../../bool' );


// MAIN //
Expand All @@ -47,7 +48,8 @@ var CTORS = [
Uint8Array,
Uint8ClampedArray,
Complex64Array,
Complex128Array
Complex128Array,
BooleanArray
];


Expand Down
5 changes: 3 additions & 2 deletions dtype/lib/dtypes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 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 @@ -32,7 +32,8 @@ var DTYPES = [
'uint8',
'uint8c',
'complex64',
'complex128'
'complex128',
'bool'
];


Expand Down

0 comments on commit 71f7e11

Please sign in to comment.