diff --git a/lib/node_modules/@stdlib/array/reviver/lib/ctors.js b/lib/node_modules/@stdlib/array/reviver/lib/ctors.js index 364fe6a1c847..68202d7ca8f2 100644 --- a/lib/node_modules/@stdlib/array/reviver/lib/ctors.js +++ b/lib/node_modules/@stdlib/array/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( '@stdlib/array/uint8' ); var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex128Array = require( '@stdlib/array/complex128' ); +var BooleanArray = require( '@stdlib/array/bool' ); // MAIN // @@ -46,7 +47,8 @@ var ctors = { 'Uint8Array': Uint8Array, 'Uint8ClampedArray': Uint8ClampedArray, 'Complex64Array': Complex64Array, - 'Complex128Array': Complex128Array + 'Complex128Array': Complex128Array, + 'BooleanArray': BooleanArray }; diff --git a/lib/node_modules/@stdlib/array/reviver/test/test.js b/lib/node_modules/@stdlib/array/reviver/test/test.js index a9da2f2753ac..253b6dc74d0f 100644 --- a/lib/node_modules/@stdlib/array/reviver/test/test.js +++ b/lib/node_modules/@stdlib/array/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( '@stdlib/array/uint8' ); var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex128Array = require( '@stdlib/array/complex128' ); +var BooleanArray = require( '@stdlib/array/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;