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