Prism · Predicates
$empty
True for null, an empty string, an empty list and an empty object. Everything else is not empty, 0 and false included.
{ nothing: null, text: '', list: [], zero: 0 }{
nothing: { $empty: { $ref: '$.nothing' } },
text: { $empty: { $ref: '$.text' } },
list: { $empty: { $ref: '$.list' } },
zero: { $empty: { $ref: '$.zero' } },
}{ nothing: true, text: true, list: true, zero: false }Runs in this page on the installed package. The input and the expected output are defined by the example.