@E18e/Has Tostringtag

1.0.5Last update Aug 9, 2024
by@e18e

has-tostringtag Codemod

Introduction

This codemod removes the has-tostringtag and has-tostringtag/shams modules from the codebase, replacing their usage with a simple boolean literal true. This effectively eliminates unnecessary dependencies, reduces the bundle size, and improves overall code performance.

Before

import hasToStringTag from 'has-tostringtag';
import hasToStringTagShams from 'has-tostringtag/shams';
if (hasToStringTag(obj)) {
// do something
}
if (hasToStringTagShams(obj)) {
// do something else
}

After

if (true) {
// do something
}
if (true) {
// do something else
}

Build custom codemods

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

background illustrationGet Started Now