Sha256: 1586b3e7b873a07da02630b4d173d131c0798995d85fcc37199507ad3ef4e603

Contents?: true

Size: 698 Bytes

Versions: 49

Compression:

Stored size: 698 Bytes

Contents

/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */

// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
  return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}

function isBuffer (obj) {
  return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}

// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}

Version data entries

49 entries across 48 versions & 17 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/is-buffer/index.js
disco_app-0.18.0 test/dummy/node_modules/is-buffer/index.js
disco_app-0.18.2 test/dummy/node_modules/is-buffer/index.js
disco_app-0.16.1 test/dummy/node_modules/is-buffer/index.js
disco_app-0.15.2 test/dummy/node_modules/is-buffer/index.js
disco_app-0.18.4 test/dummy/node_modules/is-buffer/index.js
disco_app-0.18.1 test/dummy/node_modules/is-buffer/index.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/is-buffer/index.js
disco_app-0.14.0 test/dummy/node_modules/is-buffer/index.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/is-buffer/index.js
tang-0.2.1 spec/tang_app/node_modules/is-buffer/index.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/is-buffer/index.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/is-buffer/index.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/is-buffer/index.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/is-buffer/index.js
tang-0.2.0 spec/tang_app/node_modules/is-buffer/index.js
tang-0.1.0 spec/tang_app/node_modules/is-buffer/index.js
tang-0.0.9 spec/tang_app/node_modules/is-buffer/index.js
enju_library-0.3.8 spec/dummy/node_modules/is-buffer/index.js
jass-0.9.5 vendor/node_modules/is-buffer/index.js