UNPKG

object-deep-compare

Version:

A type-safe collection of comparison methods for objects and arrays in TypeScript/JavaScript

34 lines (33 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CircularReferenceError = exports.SchemaValidationError = void 0; /** * Schema Validation Error thrown when schema validation fails and throwOnValidationFailure is true */ class SchemaValidationError extends Error { /** * Creates a new Schema Validation Error * @param message - Error message * @param validationResult - Result of schema validation that caused the error */ constructor(message, validationResult) { super(message); this.validationResult = validationResult; this.name = 'SchemaValidationError'; } } exports.SchemaValidationError = SchemaValidationError; /** * Error thrown when a circular reference is detected and handling is set to 'error' */ class CircularReferenceError extends Error { /** * Creates a new Circular Reference Error * @param path - Path where the circular reference was detected */ constructor(path) { super(`Circular reference detected at path: ${path}`); this.name = 'CircularReferenceError'; } } exports.CircularReferenceError = CircularReferenceError;