Prism · Transform
$has
True when the whole path exists. A key that is there with the value null counts; a key that is missing does not.
{ document: { id: 'save', props: { label: null } } }{
label: {
$has: {
from: { $ref: '$.document' },
path: ['props', 'label'],
},
},
tone: {
$has: { from: { $ref: '$.document' }, path: ['props', 'tone'] },
},
}{ label: true, tone: false }Runs in this page on the installed package. The input and the expected output are defined by the example.