Skip to content
Sheetwrite

@sheetwrite/core/codec

validWorkbookTableXmlElementfunction

Report a problem

On this page

Validate inert table-rule trees before they enter snapshots or XML output. A whitelist prevents this persistence seam from becoming arbitrary markup.

Declaration

function validWorkbookTableXmlElement(
value: unknown,
expectedName: string,
budget?: {
nodes: number;
characters: number;
},
): boolean

Parameters

value: unknownrequired

The rule tree to check, from outside your code.

expectedName: stringrequired

The element name the root must have, such as autoFilter.

budget?: { nodes: number; characters: number; }optional

Node and text counters shared across several calls; omit for one tree.

Returns

boolean

true when the tree is within the allowed elements, depth and size.