Use ArrayBuffer.isView to detect Buffer and ArrayBuffer
This commit is contained in:
parent
eb51e080e5
commit
1c9421bc89
5 changed files with 4 additions and 38 deletions
|
@ -48,11 +48,6 @@ exports.defineProperties = function (exports) {
|
|||
get: function () {
|
||||
return require('../is-promise')
|
||||
}
|
||||
},
|
||||
isTypedArray: {
|
||||
get: function () {
|
||||
return require('../is-typed-array')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = function isTypedArray (val) {
|
||||
return (
|
||||
val &&
|
||||
(val instanceof Int8Array ||
|
||||
val instanceof Int16Array ||
|
||||
val instanceof Int32Array ||
|
||||
val instanceof Uint8Array ||
|
||||
val instanceof Uint8ClampedArray ||
|
||||
val instanceof Uint16Array ||
|
||||
val instanceof Uint32Array ||
|
||||
val instanceof Float32Array ||
|
||||
val instanceof Float64Array) ||
|
||||
(Object.prototype.toString.call(val).substr(-6, 5) === 'Array')
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue