File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
lib/node_modules/@stdlib/ndarray/base/dtype-resolve-enum Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function resolve( dtype ) {
50
50
if ( t === 'string' ) {
51
51
return str2enum ( dtype ) ;
52
52
}
53
- if ( t === 'object' && isInteger ( dtype . enum ) ) {
53
+ if ( t === 'object' && dtype && isInteger ( dtype . enum ) ) {
54
54
return dtype . enum ;
55
55
}
56
56
if ( isStructConstructorLike ( dtype ) ) {
Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ tape( 'the function returns `null` if unable to resolve an enumeration constant'
155
155
'bar' ,
156
156
- 99999999 ,
157
157
- 9999999999 ,
158
- - 9999999999999
158
+ - 9999999999999 ,
159
+ null ,
160
+ true ,
161
+ false
159
162
] ;
160
163
for ( i = 0 ; i < values . length ; i ++ ) {
161
164
t . strictEqual ( resolve ( values [ i ] ) , null , 'returns expected value' ) ;
You can’t perform that action at this time.
0 commit comments