mirror-rhinstaller-node-cache/typed-array-buffer
2026-10-07 14:02:33 +00:00
..
test 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
.eslintrc 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
.nycrc 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
CHANGELOG.md 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
index.d.ts 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
index.js 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
LICENSE 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
package.json 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
README.md 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00
tsconfig.json 6bcb149103748493767ce4eb69859ae015bac454f5dc3d500c50a8c25d10610a package.json 2026-10-07 14:02:33 +00:00

typed-array-buffer Version Badge

github actions coverage License Downloads

npm badge

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.

Example

const typedArrayBuffer = require('typed-array-buffer');
const assert = require('assert');

const arr = new Uint8Array(0);
assert.equal(arr.buffer, typedArrayBuffer(arr));

Tests

Simply clone the repo, npm install, and run npm test