@6river/where-filter
v2.0.0
Published
SQL where-like filter function builder
Downloads
1,167
Keywords
Readme
where-filter
Effectively a fork of loopback-filters
Works according to Loopback Where Criteria spec. With the additional support for array predicates some and all.
some
const condition = {
lines: {
some: {
status: 'good',
},
},
};
const data = {
lines: [
{
status: 'good',
},
{
status: 'bad',
},
],
};
const result = whereFilter(condition)(data);
console.log(result);
// true
all
const condition = {
lines: {
all: {
status: 'good',
},
},
};
const data = {
lines: [
{
status: 'good',
},
{
status: 'good',
},
],
};
const result = whereFilter(condition)(data);
console.log(result);
// true