|
1 | 1 | /** |
2 | 2 | * @license Apache-2.0 |
3 | 3 | * |
4 | | -* Copyright (c) 2018 The Stdlib Authors. |
| 4 | +* Copyright (c) 2024 The Stdlib Authors. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 7 | * you may not use this file except in compliance with the License. |
@@ -35,6 +35,7 @@ var Uint8Array = require( '@stdlib/array/uint8' ); |
35 | 35 | var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); |
36 | 36 | var Complex64Array = require( '@stdlib/array/complex64' ); |
37 | 37 | var Complex128Array = require( '@stdlib/array/complex128' ); |
| 38 | +var BooleanArray = require( '@stdlib/array/bool' ); |
38 | 39 | var real = require( '@stdlib/complex/real' ); |
39 | 40 | var realf = require( '@stdlib/complex/realf' ); |
40 | 41 | var imag = require( '@stdlib/complex/imag' ); |
@@ -156,6 +157,23 @@ tape( 'the function will revive a JSON-serialized typed array (Float32Array)', f |
156 | 157 | t.end(); |
157 | 158 | }); |
158 | 159 |
|
| 160 | +tape( 'the function will revive a JSON-serialized typed array (BooleanArray)', function test( t ) { |
| 161 | + var json; |
| 162 | + var arr; |
| 163 | + var out; |
| 164 | + |
| 165 | + arr = new BooleanArray( [ true, false ] ); |
| 166 | + json = JSON.stringify( toJSON( arr ) ); |
| 167 | + |
| 168 | + out = parseJSON( json, reviveTypedArray ); |
| 169 | + |
| 170 | + t.strictEqual( out instanceof BooleanArray, true, 'is an instance' ); |
| 171 | + t.strictEqual( out.get( 0 ), arr.get( 0 ), true, 'has expected value' ); |
| 172 | + t.strictEqual( out.get( 1 ), arr.get( 1 ), true, 'has expected value' ); |
| 173 | + |
| 174 | + t.end(); |
| 175 | +}); |
| 176 | + |
159 | 177 | tape( 'the function will revive a JSON-serialized typed array (Complex64Array)', function test( t ) { |
160 | 178 | var json; |
161 | 179 | var arr; |
|
0 commit comments