Prism · Composition
Pick and rename
A plain object in a config is a template: each of its values is an expression. Reading fields into new names is a template of $refs.
{
raw: {
user_id: 'u_42',
first_name: 'Ada',
last_name: 'Lovelace',
created_at: '2024-01-01',
internal_token: 'sekret',
legacy_field: 'ignored',
},
}{
id: { $ref: '$.raw.user_id' },
firstName: { $ref: '$.raw.first_name' },
lastName: { $ref: '$.raw.last_name' },
createdAt: { $ref: '$.raw.created_at' },
}{
id: 'u_42',
firstName: 'Ada',
lastName: 'Lovelace',
createdAt: '2024-01-01',
}Runs in this page on the installed package. The input and the expected output are defined by the example.