Prism · Transform
$assert
Gives value when when is truthy, and otherwise refuses with E_ASSERT and the message. It is how a config says what it will not work on.
{ document: { id: 'todos.list', title: 'Todos' } }{
$assert: {
when: { $has: { from: { $ref: '$.document' }, path: ['id'] } },
message: 'A document without an id cannot be migrated.',
value: { $ref: '$.document' },
},
}{ id: 'todos.list', title: 'Todos' }Runs in this page on the installed package. The input and the expected output are defined by the example.