@E18e/Is String

1.0.5Last update Aug 9, 2024
by@e18e

is-string Codemod

Introduction

This codemod removes the dependency on the is-string npm package by replacing its usage with a built-in JavaScript feature. It transforms all calls to isString into a usage of Object.prototype.toString.call, which improves performance and reduces the overall bundle size by eliminating unnecessary dependencies.

Before

import isString from 'is-string';
if (isString(value)) {
// Do something
}

After

if (Object.prototype.toString.call(value) === '[object String]') {
// Do something
}

Build custom codemods

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

background illustrationGet Started Now