This codemod replaces the following deprecated util.is*() methods with their modern equivalents.
What It Does
This codemod handles 15 deprecated type-checking methods:
util.isArray() → Array.isArray()
util.isBoolean() → typeof value === 'boolean'
util.isBuffer() → Buffer.isBuffer()
util.isDate() → value instanceof Date
util.isError() → Error.isError()
util.isFunction() → typeof value === 'function'
util.isNull() → value === null
util.isNullOrUndefined() → value === null || value === undefined
util.isNumber() → typeof value === 'number'
util.isObject() → value && typeof value === 'object'
util.isPrimitive() → Object(value) !== value
util.isRegExp() → value instanceof RegExp
util.isString() → typeof value === 'string'
util.isSymbol() → typeof value === 'symbol'
util.isUndefined() → typeof value === 'undefined'
Before/After Examples
Type Checks
Before:
After:
Object Type Checks
Before:
After:
Null/Undefined Checks
Before:
After:
Usage
Run this codemod on your project:
Modern JavaScript provides native type-checking mechanisms that are more performant and widely understood. These standard approaches are preferred over Node.js-specific utilities.