@E18e/Regexp.Prototype.Flags

1.0.5Last update Aug 9, 2024
by@e18e

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