Détail du package

data-view-byte-offset

inspect-js118.4mMIT1.0.1

Get the byteOffset out of a DataView, robustly.

javascript, ecmascript, dataView, data

readme

data-view-byte-offset Version Badge

github actions coverage License Downloads

npm badge

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

Example

const dataViewByteOffset = require('data-view-byte-offset');
const assert = require('assert');

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

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.1 - 2024-12-18

Commits

  • [types] use shared tsconfig d5ce484
  • [readme] update URLs f297dd2
  • [Dev Deps] update @arethetypeswrong/cli, @ljharb/eslint-config, @ljharb/tsconfig, @types/object-inspect, @types/tape, auto-changelog, es-value-fixtures, object-inspect, tape f89d994
  • [actions] split out node 10-20, and 20+ e648e1d
  • [Refactor] use call-bound directly 56d996e
  • [Dev Deps] update @arethetypeswrong/cli, tape 63abffa
  • [Tests] replace aud with npm audit a7c11a5
  • [Deps] update call-bind b86a774
  • [Dev Deps] update @ljharb/tsconfig 058bb63
  • [Deps] update call-bind 6593944
  • [Dev Deps] add missing peer dep 402219e

v1.0.0 - 2024-03-04

Commits