source: imaps-frontend/node_modules/array-buffer-byte-length/index.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 421 bytes
RevLine 
[d565449]1'use strict';
2
3var callBound = require('call-bind/callBound');
4var $byteLength = callBound('ArrayBuffer.prototype.byteLength', true);
5
6var isArrayBuffer = require('is-array-buffer');
7
8/** @type {import('.')} */
9module.exports = function byteLength(ab) {
10 if (!isArrayBuffer(ab)) {
11 return NaN;
12 }
13 return $byteLength ? $byteLength(ab) : ab.byteLength;
14}; // in node < 0.11, byteLength is an own nonconfigurable property
Note: See TracBrowser for help on using the repository browser.