@E18e/Array Buffer Byte Length

1.0.5Last update Aug 9, 2024
by@e18e

array-buffer-byte-length Codemod

Introduction

This codemod replaces the use of the array-buffer-byte-length library with the native byteLength property of ArrayBuffer instances. This transformation helps reduce dependencies and enhances performance by leveraging built-in JavaScript features.

Before

import arrayBufferByteLength from 'array-buffer-byte-length';
const buffer = new ArrayBuffer(10);
const length = arrayBufferByteLength(buffer);

After

const buffer = new ArrayBuffer(10);
const length = buffer.byteLength;

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now