mirror-rhinstaller-node-cache/data-view-buffer
2026-07-29 10:38:58 +00:00
..
test 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
.eslintrc 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
.nycrc 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
CHANGELOG.md 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
index.d.ts 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
index.js 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
LICENSE 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
package.json 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
README.md 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00
tsconfig.json 5e60d1b1ad718fed7a4313c8f92ddcb2aec2b7d4bdf17d2179db7959c05418c0 package.json 2026-07-29 10:38:58 +00:00

data-view-buffer Version Badge

github actions coverage License Downloads

npm badge

Get the ArrayBuffer out of a DataView, 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 DataView.prototype.buffer has been deleted after this module has loaded.

Example

const dataViewBuffer = require('data-view-buffer');
const assert = require('assert');

const ab = new ArrayBuffer(0);
const dv = new DataView(ab);
assert.equal(dataViewBuffer(dv), ab);

Tests

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