@E18e/Typed Array Length

/icons/calendar.svg

Last update

Aug 9, 2024

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