Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

data-view-byte-length

inspect-js118.4mMIT1.0.2TypeScript support: included

Get the byteLength out of a DataView, robustly.

javascript, ecmascript, dataview, data, view, byte, length, byteLength, robust

readme

data-view-byte-length Version Badge

github actions coverage License Downloads

npm badge

Get the byteLength 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.byteLength has been deleted after this module has loaded.

Example

const dataViewByteLength = require('data-view-byte-length');
const assert = require('assert');

const ab = new ArrayBuffer(42);
const dv = new DataView(ab);
assert.equal(dataViewByteLength(dv), 42);

Tests

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.2 - 2024-12-19

Commits

  • [readme] update URLs 79df46c
  • [actions] split out node 10-20, and 20+ 2890929
  • [Dev Deps] update @arethetypeswrong/cli, @ljharb/eslint-config, @ljharb/tsconfig, @types/object-inspect, @types/tape, auto-changelog, es-value-fixtures, object-inspect, tape 97fac7f
  • [Refactor] use call-bound directly 56f17fa
  • [Deps] update call-bind, is-data-view 254a502
  • [Tests] replace aud with npm audit 7158679
  • [Dev Deps] update @ljharb/tsconfig ed63290

v1.0.1 - 2024-03-08

Commits

  • [types] use shared tsconfig 0d5873c
  • [Dev Deps] update @arethetypeswrong/cli, tape 13c1eaf
  • [patch] fix function name a061e7b
  • [Deps] update call-bind 6603851

v1.0.0 - 2024-03-04

Commits