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 17, 2024
1 parent 8019d68 commit 92ceb7e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 8 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,28 @@ This release closes the following issue:

<!-- /.package -->

<section class="package" id="array-typed-ctors-unreleased">

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

<details>

<section class="features">

##### Features

- [`8f4b5c4`](https://github.com/stdlib-js/stdlib/commit/8f4b5c410ffb5d06bb5cce02b84c5f7043c31fa7) - add boolean dtype support to `array/typed-ctors` [(#2391)](https://github.com/stdlib-js/stdlib/pull/2391)

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

<section class="package" id="array-zero-to-unreleased">

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

<details>

- [`8f4b5c4`](https://github.com/stdlib-js/stdlib/commit/8f4b5c410ffb5d06bb5cce02b84c5f7043c31fa7) - **feat:** add boolean dtype support to `array/typed-ctors` [(#2391)](https://github.com/stdlib-js/stdlib/pull/2391) _(by Jaysukh Makvana, Athan Reines)_
- [`717af94`](https://github.com/stdlib-js/stdlib/commit/717af947ab270abc5422b6d8af7dacd8f0078ca4) - **docs:** update namespace table of contents [(##2389)](#2389) _(by stdlib-bot, Philipp Burckhardt)_
- [`79d01c7`](https://github.com/stdlib-js/stdlib/commit/79d01c7866193a9ff63510316e2ea36cafc72f8a) - **refactor:** special case boolean arrays _(by Athan Reines)_
- [`4fdb218`](https://github.com/stdlib-js/stdlib/commit/4fdb218a0272d18ce2f70d769695bceca33a7653) - **feat:** add `isBooleanArray` to namespace _(by Athan Reines)_
Expand Down
3 changes: 2 additions & 1 deletion typed-ctors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
- `int16`: signed 16-bit integers.
- `int32`: signed 32-bit integers.
- `int8`: signed 8-bit integers.
Expand Down
1 change: 1 addition & 0 deletions typed-ctors/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- int16: signed 16-bit integers.
- int32: signed 32-bit integers.
- int8: signed 8-bit integers.
Expand Down
15 changes: 14 additions & 1 deletion typed-ctors/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,6 +20,7 @@

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

/**
* Returns a `Float64Array` constructor.
Expand Down Expand Up @@ -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 <Function>
*/
declare function ctors( dtype: 'bool' ): typeof BooleanArray;

/**
* Returns an `Int32Array` constructor.
*
Expand Down
3 changes: 2 additions & 1 deletion typed-ctors/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 @@ -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
Expand Down
6 changes: 4 additions & 2 deletions typed-ctors/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 Uint8Array = require( './../../uint8' );
var Uint8ClampedArray = require( './../../uint8c' );
var Complex64Array = require( './../../complex64' );
var Complex128Array = require( './../../complex128' );
var BooleanArray = require( './../../bool' );


// MAIN //
Expand All @@ -47,7 +48,8 @@ var ctors = {
'uint8': Uint8Array,
'uint8c': Uint8ClampedArray,
'complex64': Complex64Array,
'complex128': Complex128Array
'complex128': Complex128Array,
'bool': BooleanArray
};


Expand Down
9 changes: 6 additions & 3 deletions typed-ctors/test/test.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,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' );

Expand Down Expand Up @@ -62,7 +63,8 @@ tape( 'the function returns typed array constructors', function test( t ) {
'uint8',
'uint8c',
'complex64',
'complex128'
'complex128',
'bool'
];
expected = [
Float64Array,
Expand All @@ -75,7 +77,8 @@ tape( 'the function returns typed array constructors', function test( t ) {
Uint8Array,
Uint8ClampedArray,
Complex64Array,
Complex128Array
Complex128Array,
BooleanArray
];
for ( i = 0; i < dtypes.length; i++ ) {
ctor = ctors( dtypes[ i ] );
Expand Down

0 comments on commit 92ceb7e

Please sign in to comment.