UNPKG

guardz

Version:

A simple and lightweight TypeScript type guard library for runtime type validation.

19 lines (18 loc) 588 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createValidationError = void 0; /** * Create a validation error object * @param path - The path where the error occurred * @param expectedType - The expected type * @param actualValue - The actual value that caused the error * @param message - The error message * @returns A ValidationError object */ const createValidationError = (path, expectedType, actualValue, message) => ({ path, expectedType, actualValue, message }); exports.createValidationError = createValidationError;