@E18e/Regexp.Prototype.Flags

/icons/calendar.svg

Last update

Aug 9, 2024

RegExp.prototype.flags Codemod

Introduction

This codemod removes the dependency on the regexp.prototype.flags package by eliminating unnecessary import statements and replacing usages of the package with native JavaScript functionality. It not only reduces the bundle size but also enhances performance by relying on built-in language features.

Before

import flags from 'regexp.prototype.flags';
const flagValue = flags(someRegExp);

After

const flagValue = someRegExp.flags;

Build custom codemods

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

background illustrationGet Started Now