typed-array-buffer
Get the ArrayBuffer out of a TypedArray, robustly.
Last updated 10 months ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install typed-array-buffer 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.2                                ...           latest (10 months ago)

3 Versions

  • 1.0.2                                ...           10 months ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (19)

© 2010 - cnpmjs.org x YWFE | Home | YWFE