The sparkling new language for checking things in a sane way
Match scalars, arrays, objects and grumpy cats against the query of Your choice!
Check by query
Query any type of data for a result.
This way you can filter, validate, check and gather information.
the Language
Reusable
Separate validation rules from your code, and reuse them! Just like config files and templates.
Examples
Fast & simple
Most of the stuff is done by one single class. Queries are strings or arrays.
It's fast and simple.
Configuring classes through objects and factories is... well, not.
Powerfull
You can validate, check and filter almost anything - be it user input,
environment variables, function results, objects, iterators,
deep arrays, files and so on. You can even
read objects, call methods and convert the results!
Extensible
You can extend the class with your own operators, you can use
closures as checks, you can create your own value conversions and you can do it all at runtime.
'$ @file() => (.extension $in(php, html)
&& (.size $between (10000, 200000))
&& (.mtime < -1 day))'
'$ (.title ~ "/foo.*/") && (.isFooable()) && (.bars(100, TRUE) > 125)'
'$ transit := (.subway + .bus + .tram);
@transit > 10 ? .tourism + .nightlife + $min(10, @transit / 10) : FALSE'
{'foo' : ['baz', 'bar'], 'bar' : 'foo', 'title' : {'$ne' : null}}
It's *MIT* licensed, so share the love and contribute!
comments powered by