Skip to content

Commit f47822c

Browse files
committed
[Refactor] use array-buffer-byte-length
1 parent 160d851 commit f47822c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ var objectKeys = require('object-keys');
1717
var whichBoxedPrimitive = require('which-boxed-primitive');
1818
var whichCollection = require('which-collection');
1919
var whichTypedArray = require('which-typed-array');
20+
var byteLength = require('array-buffer-byte-length');
2021

21-
var byteLength = callBound('ArrayBuffer.prototype.byteLength', true)
22-
|| function byteLength(ab) { return ab.byteLength; }; // in node < 0.11, byteLength is an own nonconfigurable property
2322
var sabByteLength = callBound('SharedArrayBuffer.prototype.byteLength', true);
2423

2524
var $getTime = callBound('Date.prototype.getTime');

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
3232
},
3333
"dependencies": {
34+
"array-buffer-byte-length": "^1.0.0",
3435
"call-bind": "^1.0.2",
3536
"es-get-iterator": "^1.1.3",
3637
"get-intrinsic": "^1.2.0",

0 commit comments

Comments
 (0)