From 0aa216701dc9067691ddcfa0dc09cb63e6d99190 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 6 Jun 2024 20:08:46 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 23 +++++++++++++++++++++++ ctors/README.md | 3 ++- ctors/docs/repl.txt | 1 + ctors/docs/types/index.d.ts | 13 +++++++++++++ ctors/docs/types/test.ts | 1 + ctors/lib/ctors.js | 4 +++- ctors/test/test.js | 9 ++++++--- 7 files changed, 49 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10af832f..7f7e0e1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1033,6 +1033,28 @@ This release closes the following issue: +
+ +#### [@stdlib/array/ctors](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/ctors) + +
+ +
+ +##### Features + +- [`1510858`](https://github.com/stdlib-js/stdlib/commit/1510858faac58b25a8c5e398ffe54545526acfe6) - add boolean dtype support in `array/ctors` [(#2308)](https://github.com/stdlib-js/stdlib/pull/2308) + +
+ + + +
+ +
+ + +
#### [@stdlib/array/defaults](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/defaults) @@ -1658,6 +1680,7 @@ A total of 13 people contributed to this release. Thank you to the following con
+- [`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)_ - [`40da309`](https://github.com/stdlib-js/stdlib/commit/40da3097c6ffaed4cd9284d6cdeff8bf11786553) - **feat:** add `map` method to `array/bool` [(#2292)](https://github.com/stdlib-js/stdlib/pull/2292) _(by Jaysukh Makvana, Athan Reines)_ diff --git a/ctors/README.md b/ctors/README.md index 08cce2a9..2b5b6cb3 100644 --- a/ctors/README.md +++ b/ctors/README.md @@ -2,7 +2,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. @@ -55,6 +55,7 @@ The function returns constructors for the following data types: - `float64`: double-precision floating-point numbers. - `complex64`: single-precision complex floating-point numbers. - `complex128`: double-precision complex floating-point numbers. +- `bool`: boolean values. - `generic`: values of any type. - `int16`: signed 16-bit integers. - `int32`: signed 32-bit integers. diff --git a/ctors/docs/repl.txt b/ctors/docs/repl.txt index 6cea26e3..6a7f5b2d 100644 --- a/ctors/docs/repl.txt +++ b/ctors/docs/repl.txt @@ -8,6 +8,7 @@ - float64: double-precision floating-point numbers. - complex64: single-precision complex floating-point numbers. - complex128: double-precision complex floating-point numbers. + - bool: boolean values. - generic: values of any type. - int16: signed 16-bit integers. - int32: signed 32-bit integers. diff --git a/ctors/docs/types/index.d.ts b/ctors/docs/types/index.d.ts index 2f45566e..504dffae 100644 --- a/ctors/docs/types/index.d.ts +++ b/ctors/docs/types/index.d.ts @@ -20,6 +20,7 @@ import Complex128Array = require( './../../../complex128' ); import Complex64Array = require( './../../../complex64' ); +import BooleanArray = require( './../../../bool' ); /** * Returns a `Float64Array` constructor. @@ -69,6 +70,18 @@ declare function ctors( dtype: 'complex128' ): typeof Complex128Array; */ declare function ctors( dtype: 'complex64' ): typeof Complex64Array; +/** +* Returns a `BooleanArray` constructor. +* +* @param dtype - data type +* @returns constructor +* +* @example +* var ctor = ctors( 'bool' ); +* // returns +*/ +declare function ctors( dtype: 'bool' ): typeof BooleanArray; + /** * Returns an `Int32Array` constructor. * diff --git a/ctors/docs/types/test.ts b/ctors/docs/types/test.ts index af3e9031..45300bb6 100644 --- a/ctors/docs/types/test.ts +++ b/ctors/docs/types/test.ts @@ -27,6 +27,7 @@ import ctors = require( './index' ); ctors( 'float32' ); // $ExpectType Float32ArrayConstructor ctors( 'complex128' ); // $ExpectType Complex128ArrayConstructor ctors( 'complex64' ); // $ExpectType Complex64ArrayConstructor + ctors( 'bool' ); // $ExpectType BooleanArrayConstructor ctors( 'int32' ); // $ExpectType Int32ArrayConstructor ctors( 'int16' ); // $ExpectType Int16ArrayConstructor ctors( 'int8' ); // $ExpectType Int8ArrayConstructor diff --git a/ctors/lib/ctors.js b/ctors/lib/ctors.js index 5c0d14e3..5e9859d2 100644 --- a/ctors/lib/ctors.js +++ b/ctors/lib/ctors.js @@ -31,6 +31,7 @@ var Uint8Array = require( './../../uint8' ); var Uint8ClampedArray = require( './../../uint8c' ); var Complex64Array = require( './../../complex64' ); var Complex128Array = require( './../../complex128' ); +var BooleanArray = require( './../../bool' ); // MAIN // @@ -48,7 +49,8 @@ var ctors = { 'uint8': Uint8Array, 'uint8c': Uint8ClampedArray, 'complex64': Complex64Array, - 'complex128': Complex128Array + 'complex128': Complex128Array, + 'bool': BooleanArray }; diff --git a/ctors/test/test.js b/ctors/test/test.js index 89f1f3f6..05e15ee9 100644 --- a/ctors/test/test.js +++ b/ctors/test/test.js @@ -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. @@ -33,6 +33,7 @@ var Uint8Array = require( './../../uint8' ); var Uint8ClampedArray = require( './../../uint8c' ); var Complex64Array = require( './../../complex64' ); var Complex128Array = require( './../../complex128' ); +var BooleanArray = require( './../../bool' ); var isFunction = require( '@stdlib/assert/is-function' ); var ctors = require( './../lib' ); @@ -63,7 +64,8 @@ tape( 'the function returns array constructors', function test( t ) { 'uint8', 'uint8c', 'complex64', - 'complex128' + 'complex128', + 'bool' ]; expected = [ Float64Array, @@ -77,7 +79,8 @@ tape( 'the function returns array constructors', function test( t ) { Uint8Array, Uint8ClampedArray, Complex64Array, - Complex128Array + Complex128Array, + BooleanArray ]; for ( i = 0; i < dtypes.length; i++ ) { ctor = ctors( dtypes[ i ] );