astro-ghostcms/.pnpm-store/v3/files/99/a41c672d8d40f94feff2e0fb4b9...

15 lines
421 B
Plaintext
Raw Normal View History

2024-02-14 19:45:06 +00:00
'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