Facilitate filters creation for JS-CRUD-API
- via npm : npm i jca_filter
import jca_filter from 'jca_filter';
// then
jca_filter(logic,otherConditions={});
- via HTML
<script src="min.js"></script>
<script>
// then
jca_filter(logic,otherConditions={});
</script>
const conditions=jca_filter(
"('field1,eq,val1' OR 'field2,eq,val2') AND 'field3,eq,val3'",
{order:'field1'}
);
/**
* conditions content
*
* {
* filter: ["field1,eq,val1","field3,eq,val3"],
* filter1: ["field2,eq,val2","field3,eq,val3"],
* order: "field1"
* }
*
*/
only OR and AND operators are available