Skip to content

selectFields ​

Gives the fields to render when code picks some by dot path, as a tree like the builder's getFieldTree gives.

ts
const fields = selectFields(nodes, options)

Parameters ​

  • nodes readonly FieldNode[]
  • options { only?: readonly string[]; except?: readonly string[] }: optional

Explanation ​

  • only keeps just the fields it names, in the order of the definition, each with the fields inside it. A display element has no dot path, so it is left out.
  • except leaves out the fields it names, at any depth. 'lines.*.note' leaves a field out of every item of a list.

A path that names no field throws a TypeError, and so does a field of a list's items in only.

Returns ​

Functions ​

Guides ​