ryardley/pdsl

Implement bang predicates

ryardley opened this issue · 1 comments

We should be able to use bangs to denote truthy and falsy values.

p`{name: !}`({name:1}); // false
p`{name: !}`({name:0}); // true
p`{name: !}`({name:"false"}); // false
p`{name: !}`({name:false}); // true

p`{name: !!}`({name:0}); // false
p`{name: !!}`({name:1}); // true
p`{name: !!}`({name:"true"}); // true
p`{name: !!}`({name:false}); // false

p`!`(0); // true
p`!!`(false); // false
p`!!`(true); // true

This has been released