Skip to content

Documentation / @facturometro/validator / CompiledRuleset

Interface: CompiledRuleset ​

Defined in: packages/validator/src/engine/compile.ts:61

A compiled composition: the rules in evaluation order, the composed defaults hook, the resolved configuration of the structural rules and what the issues report as ruleset.

Example ​

ts
import type { CompiledRuleset } from '@facturometro/validator';

const size = (compiled: CompiledRuleset) => compiled.rules.length;

Properties ​

applyStructural ​

readonly applyStructural: (issue) => Issue | undefined

Defined in: packages/validator/src/engine/compile.ts:76

Applies the composition's configuration of structural rule ids (UBL-CR-*, UBL-SR-*, UBL-DT-*) to an issue, typically a diagnostic of @facturometro/parser. validate() reports no parser diagnostics, so it never calls this; the umbrella's validateXml() does, for the diagnostics it merges into its result.

Parameters ​

issue ​

Issue

The issue.

Returns ​

Issue | undefined

undefined when a constant disabled the issue's structural id. For a structural id that is also a rule of the composition (a bespoke UBL-SR or UBL-DT rule), the issue with that compiled rule's final severity and message, after every replacement and override. For any other structural id, the issue with the severity and message the constants' overrides set, the later one winning per field. The issue itself when nothing changes, for an id that is not structural included.


info ​

readonly info: RulesetInfo

Defined in: packages/validator/src/engine/compile.ts:78

The composed ids and versions, in list order.


normalize ​

readonly normalize: Normalizer | undefined

Defined in: packages/validator/src/engine/compile.ts:80

The defaults hooks of the composition, run in list order; undefined when there is none.


rules ​

readonly rules: readonly CompiledRule[]

Defined in: packages/validator/src/engine/compile.ts:82

The rules, in evaluation order: list order, then rule order within each constant.

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