Sha256: a4ccae1f8bee3671d9c563feb784cc65c0cf88aa28263035c707ce4e1b014147

Contents?: true

Size: 1016 Bytes

Versions: 114

Compression:

Stored size: 1016 Bytes

Contents

module.exports      = isTypedArray
isTypedArray.strict = isStrictTypedArray
isTypedArray.loose  = isLooseTypedArray

var toString = Object.prototype.toString
var names = {
    '[object Int8Array]': true
  , '[object Int16Array]': true
  , '[object Int32Array]': true
  , '[object Uint8Array]': true
  , '[object Uint8ClampedArray]': true
  , '[object Uint16Array]': true
  , '[object Uint32Array]': true
  , '[object Float32Array]': true
  , '[object Float64Array]': true
}

function isTypedArray(arr) {
  return (
       isStrictTypedArray(arr)
    || isLooseTypedArray(arr)
  )
}

function isStrictTypedArray(arr) {
  return (
       arr instanceof Int8Array
    || arr instanceof Int16Array
    || arr instanceof Int32Array
    || arr instanceof Uint8Array
    || arr instanceof Uint8ClampedArray
    || arr instanceof Uint16Array
    || arr instanceof Uint32Array
    || arr instanceof Float32Array
    || arr instanceof Float64Array
  )
}

function isLooseTypedArray(arr) {
  return names[toString.call(arr)]
}

Version data entries

114 entries across 108 versions & 23 rubygems

Version Path
trusty-cms-6.3.1 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.51 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.50 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.49 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.48 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.47 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.46 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.45 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.44 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.43 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.42 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.41 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.40 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.39 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.38 node_modules/is-typedarray/index.js
optimacms-0.1.61 spec/dummy/node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.32 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.31 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.30 node_modules/is-typedarray/index.js
immosquare-cleaner-0.1.29 node_modules/is-typedarray/index.js