feige
2024-12-17 4b1fbea0d8099259ea7d0ef10bd7633c3bc62f2e
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';
 
var callBound = require('call-bind/callBound');
var $byteLength = callBound('ArrayBuffer.prototype.byteLength', true);
 
var isArrayBuffer = require('is-array-buffer');
 
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