Skip to content

Documentation / @facturometro/einvoice / ValidationResult

Type Alias: ValidationResult<D> ​

ValidationResult<D> = ValidationFailure | ValidationSuccess<D>

Defined in: packages/validator/src/engine/validate.ts:187

What validate returns; narrow on ok to reach the validated document.

Type Parameters ​

D ​

D extends Document = Document

Example ​

ts
import { validate } from '@facturometro/validator';

const result = validate(parsed.document);
if (result.ok) {
  result.document.id; // typed as Invoice
} else {
  result.fatal.map((issue) => issue.id);
}

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.