home
This commit is contained in:
parent
a71a3b5593
commit
cb52890889
16657 changed files with 1483086 additions and 1 deletions
14
home/ags/node_modules/array-buffer-byte-length/index.js
generated
vendored
Normal file
14
home/ags/node_modules/array-buffer-byte-length/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var $byteLength = callBound('ArrayBuffer.prototype.byteLength', true);
|
||||
|
||||
var isArrayBuffer = require('is-array-buffer');
|
||||
|
||||
/** @type {import('.')} */
|
||||
module.exports = function byteLength(ab) {
|
||||
if (!isArrayBuffer(ab)) {
|
||||
return NaN;
|
||||
}
|
||||
return $byteLength ? $byteLength(ab) : ab.byteLength;
|
||||
}; // in node < 0.11, byteLength is an own nonconfigurable property
|
||||
Loading…
Add table
Add a link
Reference in a new issue