@E18e/Concat Map

1.0.5Last update Aug 9, 2024
by@e18e

concat-map Codemod

Introduction

This codemod replaces the use of the concat-map method with the built-in flatMap array method. This transformation helps to reduce dependencies on external utility libraries by utilizing native JavaScript functionality, thereby improving performance and reducing bundle size.

Before

const result = array.concatMap(item => transform(item));

After

const result = array.flatMap(item => transform(item));

Build custom codemods

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

background illustrationGet Started Now