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 21, 2024
1 parent 88b80eb commit d536e63
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,28 @@ This release closes the following issue:

<!-- /.package -->

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

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

<details>

<section class="features">

##### Features

- [`4f30f21`](https://github.com/stdlib-js/stdlib/commit/4f30f213c8ec0a95cdcd7dfe7e7a6bf4bec8bd36) - add boolean dtype support to `array/reviver` [(#2420)](https://github.com/stdlib-js/stdlib/pull/2420)

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

<section class="package" id="array-safe-casts-unreleased">

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

<details>

- [`4f30f21`](https://github.com/stdlib-js/stdlib/commit/4f30f213c8ec0a95cdcd7dfe7e7a6bf4bec8bd36) - **feat:** add boolean dtype support to `array/reviver` [(#2420)](https://github.com/stdlib-js/stdlib/pull/2420) _(by Jaysukh Makvana)_
- [`42c67e7`](https://github.com/stdlib-js/stdlib/commit/42c67e76cdf919e4e43ff9333d9acc6177eb5558) - **feat:** add `every` and `some` methods to `array/bool` [(#2421)](https://github.com/stdlib-js/stdlib/pull/2421) _(by Jaysukh Makvana, Athan Reines)_
- [`d301be9`](https://github.com/stdlib-js/stdlib/commit/d301be9e2cabe07efe219c00d10aebd15e0673e7) - **fix:** ensure support for real-to-complex casting in boolean and mask array indexing _(by Athan Reines)_
- [`0b727a5`](https://github.com/stdlib-js/stdlib/commit/0b727a5d922225d23693e456b5f7b5b82f63750a) - **feat:** add `mskput` to namespace _(by Athan Reines)_
Expand Down
6 changes: 4 additions & 2 deletions reviver/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 @@ -46,7 +47,8 @@ var ctors = {
'Uint8Array': Uint8Array,
'Uint8ClampedArray': Uint8ClampedArray,
'Complex64Array': Complex64Array,
'Complex128Array': Complex128Array
'Complex128Array': Complex128Array,
'BooleanArray': BooleanArray
};


Expand Down
20 changes: 19 additions & 1 deletion reviver/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 @@ -35,6 +35,7 @@ var Uint8Array = require( './../../uint8' );
var Uint8ClampedArray = require( './../../uint8c' );
var Complex64Array = require( './../../complex64' );
var Complex128Array = require( './../../complex128' );
var BooleanArray = require( './../../bool' );
var real = require( '@stdlib/complex/real' );
var realf = require( '@stdlib/complex/realf' );
var imag = require( '@stdlib/complex/imag' );
Expand Down Expand Up @@ -156,6 +157,23 @@ tape( 'the function will revive a JSON-serialized typed array (Float32Array)', f
t.end();
});

tape( 'the function will revive a JSON-serialized typed array (BooleanArray)', function test( t ) {
var json;
var arr;
var out;

arr = new BooleanArray( [ true, false ] );
json = JSON.stringify( toJSON( arr ) );

out = parseJSON( json, reviveTypedArray );

t.strictEqual( out instanceof BooleanArray, true, 'is an instance' );
t.strictEqual( out.get( 0 ), arr.get( 0 ), true, 'has expected value' );
t.strictEqual( out.get( 1 ), arr.get( 1 ), true, 'has expected value' );

t.end();
});

tape( 'the function will revive a JSON-serialized typed array (Complex64Array)', function test( t ) {
var json;
var arr;
Expand Down

0 comments on commit d536e63

Please sign in to comment.