Skip to content

Commit ddf7026

Browse files
committed
used the "typeof" check directly to avoid the "is not defined" reference error
1 parent 4a991d1 commit ddf7026

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ var TYPED_ARRAY_CTORS = {
2222
'Float64Array': Float64Array
2323
};
2424

25-
function isFunction (value) {
26-
return typeof value === 'function';
27-
}
28-
29-
var ARRAY_BUFFER_SUPPORTED = isFunction(ArrayBuffer);
30-
var MAP_SUPPORTED = isFunction(Map);
31-
var SET_SUPPORTED = isFunction(Set);
32-
var BUFFER_FROM_SUPPORTED = isFunction(Buffer);
25+
var ARRAY_BUFFER_SUPPORTED = typeof ArrayBuffer === 'function';
26+
var MAP_SUPPORTED = typeof Map === 'function';
27+
var SET_SUPPORTED = typeof Set === 'function';
28+
var BUFFER_FROM_SUPPORTED = typeof Buffer === 'function';
3329

3430
var TYPED_ARRAY_SUPPORTED = function (typeName) {
35-
return isFunction(TYPED_ARRAY_CTORS[typeName]);
31+
return typeof TYPED_ARRAY_CTORS[typeName] === 'function';
3632
};
3733

3834
// Saved proto functions

0 commit comments

Comments
 (0)