UNPKG

@umbrelladocs/rdformat-validator

Version:

Validate and fix Reviewdog Diagnostic Format (RD Format) - A comprehensive library and CLI tool for validating JSON data against the Reviewdog Diagnostic Format specification

61 lines 1.87 kB
/** * Fixer module for automatically correcting common RDFormat validation errors */ import { ValidationError, ValidationResult, FixerOptions, FixResult, AppliedFix } from '../types/validation'; /** * Fixer class that can automatically correct common validation errors */ export declare class Fixer { private options; constructor(options?: FixerOptions); /** * Attempts to fix validation errors in the provided data */ fix(data: any, validationResult: ValidationResult): FixResult; /** * Checks if a specific validation error can be automatically fixed */ canFix(error: ValidationError): boolean; /** * Applies a fix for a specific validation error */ applyFix(data: any, error: ValidationError): AppliedFix | null; /** * Fixes type mismatches through coercion */ private fixTypeMismatch; /** * Fixes missing required properties by adding default values */ private fixMissingProperty; /** * Fixes empty strings with meaningful defaults */ private fixEmptyString; /** * Fixes number constraint violations */ private fixNumberViolation; /** * Fixes invalid severity values */ private fixInvalidSeverity; /** * Fixes invalid position values */ private fixInvalidPosition; /** * Helper methods for path manipulation and value access */ private parsePath; private getValueAtPath; private setValueAtPath; private deepClone; private extractExpectedType; private canFixTypeMismatch; private canFixMissingProperty; private getFixMessage; } export declare function createFixer(options?: FixerOptions): Fixer; export declare function fixData(data: any, validationResult: ValidationResult, options?: FixerOptions): FixResult; //# sourceMappingURL=index.d.ts.map