File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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)_
Original file line number Diff line number Diff line change 1818
1919'use strict' ;
2020
21+ // MODULES //
22+
23+ var isNumber = require ( '@stdlib/assert/is-number' ) . isPrimitive ;
24+
25+
2126// MAIN //
2227
2328/**
3439*/
3540function 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 ;
You can’t perform that action at this time.
0 commit comments