From d536e6398dbf9210444a67c578807eda664e3e5c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 21 Jun 2024 18:45:44 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 23 +++++++++++++++++++++++ reviver/lib/ctors.js | 6 ++++-- reviver/test/test.js | 20 +++++++++++++++++++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7384f63..3155a354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1823,6 +1823,28 @@ This release closes the following issue: +
+ +#### [@stdlib/array/reviver](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/reviver) + +
+ +
+ +##### 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) + +
+ + + +
+ +
+ + +
#### [@stdlib/array/safe-casts](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/safe-casts) @@ -2164,6 +2186,7 @@ A total of 13 people contributed to this release. Thank you to the following con
+- [`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)_ diff --git a/reviver/lib/ctors.js b/reviver/lib/ctors.js index 8beb48e8..791afbd4 100644 --- a/reviver/lib/ctors.js +++ b/reviver/lib/ctors.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. @@ -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 // @@ -46,7 +47,8 @@ var ctors = { 'Uint8Array': Uint8Array, 'Uint8ClampedArray': Uint8ClampedArray, 'Complex64Array': Complex64Array, - 'Complex128Array': Complex128Array + 'Complex128Array': Complex128Array, + 'BooleanArray': BooleanArray }; diff --git a/reviver/test/test.js b/reviver/test/test.js index 040ca070..8d05ec0f 100644 --- a/reviver/test/test.js +++ b/reviver/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. @@ -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' ); @@ -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;