Skip to content

Commit b4d23fb

Browse files
committed
Auto-generated commit
1 parent 76f58a1 commit b4d23fb

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153

154154
##### Bug Fixes
155155

156+
- [`5e2bbef`](https://github.com/stdlib-js/stdlib/commit/5e2bbef14efd5937e23047c01af0e740e6cbd4f6) - add missing boolean array support
156157
- [`aea44c9`](https://github.com/stdlib-js/stdlib/commit/aea44c9c8699a4d748c0db70d4a60801bfc03c40) - update loop limit
157158

158159
</section>
@@ -477,6 +478,7 @@ A total of 3 people contributed to this release. Thank you to the following cont
477478

478479
<details>
479480

481+
- [`5e2bbef`](https://github.com/stdlib-js/stdlib/commit/5e2bbef14efd5937e23047c01af0e740e6cbd4f6) - **fix:** add missing boolean array support _(by Athan Reines)_
480482
- [`be3e0b9`](https://github.com/stdlib-js/stdlib/commit/be3e0b984eb981caa758172dc7179cbd6a118a2e) - **fix:** treat generic accessor arrays similar to built-in generic arrays _(by Athan Reines)_
481483
- [`8f2808d`](https://github.com/stdlib-js/stdlib/commit/8f2808dec8c8a6508841e86453fba823823efc6c) - **docs:** update related packages sections [(#4302)](https://github.com/stdlib-js/stdlib/pull/4302) _(by stdlib-bot)_
482484
- [`4a70790`](https://github.com/stdlib-js/stdlib/commit/4a707903dfef7c2b56216000165706497d19a251) - **style:** add missing spaces _(by Philipp Burckhardt)_

base/ctor/lib/tostring.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ var CTORS = {
4040
'generic': '[ {{data}} ]',
4141
'binary': 'new Buffer( [ {{data}} ] )',
4242
'complex64': 'new Complex64Array( [ {{data}} ] )',
43-
'complex128': 'new Complex128Array( [ {{data}} ] )'
43+
'complex128': 'new Complex128Array( [ {{data}} ] )',
44+
'bool': 'new BooleanArray( [ {{data}} ] )'
4445
};
4546

4647

base/ctor/test/test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var Float64Array = require( '@stdlib/array/float64' );
2626
var Uint8Array = require( '@stdlib/array/uint8' );
2727
var Complex64Array = require( '@stdlib/array/complex64' );
2828
var Complex128Array = require( '@stdlib/array/complex128' );
29+
var BooleanArray = require( '@stdlib/array/bool' );
2930
var Complex64 = require( '@stdlib/complex/float32/ctor' );
3031
var Complex128 = require( '@stdlib/complex/float64/ctor' );
3132
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
@@ -3445,6 +3446,37 @@ tape( 'an ndarray has a custom `toString()` method (complex type)', function tes
34453446
t.end();
34463447
});
34473448

3449+
tape( 'an ndarray has a custom `toString()` method (boolean type)', function test( t ) {
3450+
var expected;
3451+
var strides;
3452+
var actual;
3453+
var buffer;
3454+
var offset;
3455+
var dtype;
3456+
var order;
3457+
var shape;
3458+
var arr;
3459+
3460+
dtype = 'bool';
3461+
buffer = new BooleanArray( [ true, false, true, false ] );
3462+
shape = [ 2, 2 ];
3463+
order = 'row-major';
3464+
strides = [ 2, 1 ];
3465+
offset = 0;
3466+
3467+
arr = ndarray( dtype, buffer, shape, strides, offset, order );
3468+
3469+
t.strictEqual( hasOwnProp( arr, 'toString' ), false, 'does not have own property' );
3470+
t.strictEqual( hasProp( arr, 'toString' ), true, 'has property' );
3471+
t.strictEqual( isFunction( arr.toString ), true, 'has method' );
3472+
3473+
expected = 'ndarray( \'bool\', new BooleanArray( [ true, false, true, false ] ), [ 2, 2 ], [ 2, 1 ], 0, \'row-major\' )';
3474+
actual = arr.toString();
3475+
t.strictEqual( actual, expected, 'returns expected value' );
3476+
3477+
t.end();
3478+
});
3479+
34483480
tape( 'an ndarray has a custom `toString()` method (complex type)', function test( t ) {
34493481
var expected;
34503482
var strides;

0 commit comments

Comments
 (0)