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

main
Last change on this file since d565449 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.