Skip to content

Documentation / @einvoice-ts/validator / Hit

Interface: Hit<N, P> ​

Defined in: packages/validator/src/engine/rule.ts:53

One node a rule's context selected: the node, where it is, and (when it is not the root) the aggregate that contains it.

Example ​

ts
import type { Hit, UncheckedTaxSubtotal } from '@einvoice-ts/validator';

const hit: Hit<UncheckedTaxSubtotal> = {
  node: subtotal,
  parent: taxTotal,
  path: ['taxTotal', 0, 'taxSubtotal', 0],
};

Type Parameters ​

N ​

N = unknown

P ​

P = unknown

Properties ​

node ​

readonly node: N

Defined in: packages/validator/src/engine/rule.ts:55

The selected node.


parent? ​

readonly optional parent?: P

Defined in: packages/validator/src/engine/rule.ts:57

The aggregate the node sits in, when the node is not the document root.


path ​

readonly path: ModelPath

Defined in: packages/validator/src/engine/rule.ts:59

Model path of the node, from the document root.


xpath? ​

readonly optional xpath?: string

Defined in: packages/validator/src/engine/rule.ts:64

XPath of the node, when its model path cannot name it: an element the parser dropped, whose path is the one the model would have given it. The issue's xpath and contextXPath use it.

MIT licensed. Specification material belongs to OpenPeppol, CEN and OASIS (see NOTICE). Peppol is a trademark of OpenPeppol AISBL; this project is not affiliated with it.