mirror-rhinstaller-node-cache/typed-array-buffer
2026-05-11 11:21:53 +00:00
..
test dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
.eslintrc dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
.nycrc dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
CHANGELOG.md dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
index.d.ts dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
index.js dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
LICENSE dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
package.json dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
README.md dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +00:00
tsconfig.json dc62fd92941924495660734286311a3d44d6e15c919694aab2b00ce84bf0c990 package.json 2026-05-11 11:21:53 +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