|
преди 1 месец | |
---|---|---|
.. | ||
.github | преди 1 месец | |
test | преди 1 месец | |
.eslintrc | преди 1 месец | |
.nycrc | преди 1 месец | |
CHANGELOG.md | преди 1 месец | |
LICENSE | преди 1 месец | |
README.md | преди 1 месец | |
index.d.ts | преди 1 месец | |
index.js | преди 1 месец | |
package.json | преди 1 месец | |
tsconfig.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