@E18e/String.Prototype.Matchall

/icons/calendar.svg

Last update

Aug 9, 2024

Codemod for Replacing string.prototype.matchall

Introduction

This codemod replaces calls to the string.prototype.matchall npm package with the built-in String.prototype.matchAll method. The goal is to eliminate the dependency on the string.prototype.matchall package, thereby reducing bundle size and enhancing performance.

Before

import matchAll from 'string.prototype.matchall';
const result = matchAll("test string", /test/g);

After

const result = "test string".matchAll(/test/g);

Build custom codemods

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

background illustrationGet Started Now