Skip to content

Commit

Permalink
style: correct typeof's in some way
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyBelym committed May 24, 2021
1 parent 27d85fe commit 11a4cf3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ var GLOBAL = (function getGlobal () {
})();

var TYPED_ARRAY_CTORS = {
'Int8Array': typeof Int8Array !== 'undefined' ? Int8Array : void 0,
'Uint8Array': typeof Uint8Array !== 'undefined' ? Uint8Array : void 0,
'Uint8ClampedArray': typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : void 0,
'Int16Array': typeof Int16Array !== 'undefined' ? Int16Array : void 0,
'Uint16Array': typeof Uint16Array !== 'undefined' ? Uint16Array : void 0,
'Int32Array': typeof Int32Array !== 'undefined' ? Int32Array : void 0,
'Uint32Array': typeof Uint32Array !== 'undefined' ? Uint32Array : void 0,
'Float32Array': typeof Float32Array !== 'undefined' ? Float32Array : void 0,
'Float64Array': typeof Float64Array !== 'undefined' ? Float64Array : void 0
'Int8Array': typeof Int8Array === 'function' ? Int8Array : void 0,
'Uint8Array': typeof Uint8Array === 'function' ? Uint8Array : void 0,
'Uint8ClampedArray': typeof Uint8ClampedArray === 'function' ? Uint8ClampedArray : void 0,
'Int16Array': typeof Int16Array === 'function' ? Int16Array : void 0,
'Uint16Array': typeof Uint16Array === 'function' ? Uint16Array : void 0,
'Int32Array': typeof Int32Array === 'function' ? Int32Array : void 0,
'Uint32Array': typeof Uint32Array === 'function' ? Uint32Array : void 0,
'Float32Array': typeof Float32Array === 'function' ? Float32Array : void 0,
'Float64Array': typeof Float64Array === 'function' ? Float64Array : void 0
};

var ARRAY_BUFFER_SUPPORTED = typeof ArrayBuffer === 'function';
Expand All @@ -28,7 +28,7 @@ var SET_SUPPORTED = typeof Set === 'function';
var BUFFER_FROM_SUPPORTED = typeof Buffer === 'function';

var TYPED_ARRAY_SUPPORTED = function (typeName) {
return typeof TYPED_ARRAY_CTORS[typeName] === 'function';
return !!TYPED_ARRAY_CTORS[typeName];
};

// Saved proto functions
Expand Down

0 comments on commit 11a4cf3

Please sign in to comment.