UNPKG

@sentzunhat/zacatl

Version:

A modular, high-performance TypeScript microservice framework for Node.js, featuring layered architecture, dependency injection, and robust validation for building scalable APIs and distributed systems.

20 lines 600 B
export const isError = (error) => { return error instanceof Error; }; export const isZodError = (error) => { return (error !== null && typeof error === 'object' && 'name' in error && typeof error['name'] === 'string' && error['name'] === 'ZodError'); }; export const isCustomError = (error) => { return isError(error) && 'code' in error; }; export const isNodeError = (error) => { return isError(error) && 'code' in error; }; export const isSyntaxError = (error) => { return error instanceof SyntaxError; }; //# sourceMappingURL=error-guards.js.map