@E18e/Array.Prototype.Flat

1.0.5Last update Aug 9, 2024
by@e18e

Array.prototype.flat Codemod

Introduction

This codemod replaces instances of the Array.prototype.flatten method with the native Array.prototype.flat method. The goal is to utilize built-in JavaScript features, reducing dependencies and improving performance in the codebase.

Before

const flattenedArray = array.flatten();

After

const flattenedArray = array.flat();

Build custom codemods

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

background illustrationGet Started Now