@E18e/Is Number Object

1.0.5Last update Aug 9, 2024
by@e18e

is-number-object Codemod

Introduction

This codemod replaces the usage of the is-number-object npm module with a built-in JavaScript approach. It transforms the code to use Object.prototype.toString.call for checking if a value is a number, removing the dependency and enhancing performance by leveraging native capabilities.

Before

import isNumber from 'is-number-object';
const result = isNumber(value);

After

const result = Object.prototype.toString.call(value) === '[object Number]';

Build custom codemods

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

background illustrationGet Started Now