This codemod replaces the usage of the data-view-byte-offset npm module with a direct utilization of the built-in DataView feature in JavaScript. It eliminates the unnecessary dependency, reduces bundle size, and leverages native functionality for improved performance.
Before
javascript
import { byteOffset } from 'data-view-byte-offset';
const view = new DataView(buffer);
const offset = byteOffset(view, index);
After
javascript
const view = new DataView(buffer);
const offset = view.byteOffset(index);
Ready to evolve your codebase?
Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.