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
nodesreadonly FieldNode[]options{ only?: readonly string[]; except?: readonly string[] }: optional
Explanation
onlykeeps 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.exceptleaves 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
fieldsFieldNode[]