Skip to content

Commit e0d39b1

Browse files
committed
Auto-generated commit
1 parent 391333b commit e0d39b1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ A total of 37 issues were closed in this release:
667667

668668
<details>
669669

670+
- [`35c585c`](https://github.com/stdlib-js/stdlib/commit/35c585c9c40c66b881df40578a18331bafc3c48e) - **refactor:** use assertion utility _(by Athan Reines)_
670671
- [`9333f71`](https://github.com/stdlib-js/stdlib/commit/9333f717337007d160cb66e57e7a97d4da2ff0c0) - **test:** add tests for DataType instances _(by Athan Reines)_
671672
- [`908b8bb`](https://github.com/stdlib-js/stdlib/commit/908b8bbc9abb690c1038d9a31eb99dc079584667) - **docs:** update `ndarray` TypeScript declarations [(#9405)](https://github.com/stdlib-js/stdlib/pull/9405) _(by stdlib-bot)_
672673
- [`880be90`](https://github.com/stdlib-js/stdlib/commit/880be90c78565355d6e6616def13ccf5037faeca) - **style:** add missing spaces before closing bracket _(by Philipp Burckhardt)_

base/ndims/lib/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
24+
25+
2126
// MAIN //
2227

2328
/**
@@ -34,7 +39,7 @@
3439
*/
3540
function ndims( x ) {
3641
var n = x.ndims; // Note: intentionally cache in case `ndims` is lazily resolved via accessor
37-
if ( typeof n === 'number' ) {
42+
if ( isNumber( n ) ) {
3843
return n;
3944
}
4045
return x.shape.length;

0 commit comments

Comments
 (0)