@willwade/aac-processors
    Preparing search index...

    Class BaseValidatorAbstract

    Base class for all format validators Provides the check-based validation system

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _blocked: boolean = false
    _checks: ValidationCheck[] = []
    _errors: number = 0
    _sub_checks: ValidationResult[] = []
    _warnings: number = 0

    Accessors

    Methods

    • Add a validation check that will be executed

      Parameters

      • type: string

        Category of the check

      • description: string

        Human-readable description

      • checkFn: () => Promise<void>

        Async function that performs the check

      Returns Promise<void>

    • Add a synchronous validation check

      Parameters

      • type: string
      • description: string
      • checkFn: () => void

      Returns void

    • Throw a validation error

      Parameters

      • message: string

        Error message

      • blocker: boolean = false

        If true, stop further validation

      Returns never

    • Abstract method - each validator must implement this

      Parameters

      • content: any

        The content to validate (can be string, buffer, object, etc.)

      • filename: string

        Name of the file being validated

      • filesize: number

        Size of the file in bytes

      Returns Promise<ValidationResult>

    • Static helper to identify if content is this validator's format

      Parameters

      • _content: any
      • _filename: string

      Returns Promise<boolean>