alter - PeterNaydenov/code-assembly-line GitHub Wiki
Will change property names of the current-data to fit the required template placeholders.
Fields
{
do : 'alter'
, data : changes
, select ?: items
}
Types
- items: string | number | Array < string | number >. Represent elements in the list. There are few predefined values: 'first','last','all'. Use number to define element from start to end or (-number) from end to start. Missing selection param is equal to:
select: ['all']
- changes: { before : after }, where before is actual property name that will be renamed to after.
Example
{ do: 'alter', data: {'user':'text'} }
If current-data has item { user: 'Peter' }, item will be converted to {text: Peter} in order to fit template requirements - existing template placeholders.