@E18e/Typed Array Length

1.0.5Last update Aug 9, 2024
by@e18e

Typed Array Length Codemod

Introduction

This codemod removes the dependency on the typed-array-length package and replaces its usage with the native length property of typed arrays. The goal is to reduce unnecessary dependencies, minimize bundle size, and leverage built-in JavaScript features for improved performance.

Before

import typedArrayLength from 'typed-array-length';
const array = new Uint8Array(10);
const length = typedArrayLength(array);

After

const array = new Uint8Array(10);
const length = array.length;

Build custom codemods

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

background illustrationGet Started Now