bare-buffer
Advanced tools
Comparing version 2.4.1 to 2.4.2
16
index.js
@@ -10,2 +10,6 @@ const constants = require('./lib/constants') | ||
const Buffer = module.exports = exports = class Buffer extends Uint8Array { | ||
static { | ||
binding.tag(this) | ||
} | ||
[Symbol.species] () { | ||
@@ -379,3 +383,13 @@ return Buffer | ||
exports.isBuffer = function isBuffer (value) { | ||
return value instanceof Buffer | ||
if (typeof value !== 'object' || value === null) return false | ||
let constructor = value.constructor | ||
while (typeof constructor === 'function') { | ||
if (binding.isTagged(constructor)) return true | ||
constructor = Reflect.getPrototypeOf(constructor) | ||
} | ||
return false | ||
} | ||
@@ -382,0 +396,0 @@ |
{ | ||
"name": "bare-buffer", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "Native buffers for JavaScript", | ||
@@ -5,0 +5,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
454
348785