prc b6c02717e6 Upload complete no-internet building environment. | 1 年之前 | |
---|---|---|
.. | ||
.github | 1 年之前 | |
test | 1 年之前 | |
.eslintrc | 1 年之前 | |
.nycrc | 1 年之前 | |
CHANGELOG.md | 1 年之前 | |
LICENSE | 1 年之前 | |
README.md | 1 年之前 | |
index.js | 1 年之前 | |
package.json | 1 年之前 |
Get the ArrayBuffer out of a TypedArray, robustly.
This will work in node <= 0.10 and < 0.11.4, where there's no prototype accessor, only a nonconfigurable own property.
It will also work in modern engines where TypedArray.prototype.buffer
has been deleted after this module has loaded.
const typedArrayBuffer = require('typed-array-buffer');
const assert = require('assert');
const arr = new Uint8Array(0);
assert.equal(arr.buffer, typedArrayBuffer(arr));
Simply clone the repo, npm install
, and run npm test