Skip to content

Documentation / @einvoice-ts/validator / createDocumentView

Function: createDocumentView() ​

createDocumentView(document): DocumentView

Defined in: packages/validator/src/engine/view.ts:853

Creates the memoized view of a document.

Parameters ​

document ​

UncheckedDocument

An invoice or credit note of any family (canonical or unchecked).

Returns ​

DocumentView

The view.

Example ​

ts
import { createDocumentView } from '@einvoice-ts/validator';

const view = createDocumentView(invoice);
view.lines().length; // 2

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.