Skip to main content
This recipe transforms the usage of types.isNativeError to use Error.isError() to handle Node.js DEP0197.

What It Does

This codemod replaces:
  • types.isNativeError() calls with Error.isError()
  • Removes unnecessary util imports when no longer needed

Before/After

Before:
After:

Usage

Run this codemod on your project:
Error.isError() is now the preferred way to check if a value is an Error object. This method is available globally without requiring any imports.