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.

The source
{ document: { id: 'save', props: { label: null } } }
The config
{
  label: {
    $has: {
      from: { $ref: '$.document' },
      path: ['props', 'label'],
    },
  },
  tone: {
    $has: { from: { $ref: '$.document' }, path: ['props', 'tone'] },
  },
}
What comes out
{ label: true, tone: false }
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.