Primitive
array.project
BETAShort name: project
Version: 1.0.0
Project each element of an array into a new object by mapping output keys to source path(s), with first-present fallback and defaults. Lets a read verb shape an atom list into display rows.
Back to primitive libraryInputs
| Key | Type | Required | Description |
|---|---|---|---|
| array | array | true | Array of source objects to project. |
| fields | array | true | Projection specs. Each: { as: string, path?: string, firstOf?: string[], default?: any }. Use `path` for one source path, `firstOf` for an ordered fallback list; `default` is used when nothing is present. |
Outputs
| Key | Type | Required | Description |
|---|---|---|---|
| result | array | false | Array of projected objects, one per input element. |