@E18e/Array.Prototype.Map

1.0.5Last update Aug 9, 2024
by@e18e

array.prototype.map Codemod

Introduction

This codemod transforms usages of the Array.prototype.map method to ensure that it correctly applies to array instances. The goal is to standardize array handling in the codebase, improving readability and performance by leveraging built-in ES features.

Before

const results = dirtyArray.map((item) => item.value);

After

const results = Array.prototype.map.call(dirtyArray, (item) => item.value);

Build custom codemods

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

background illustrationGet Started Now