@criterium/core
v0.4.0
Published
helper to create mongo-like filtering
Downloads
29
Readme
@criterium/core
an generic helper to create mongo-like filter.
install
npm i @criterium/coreusage
import { converter } from '@criterium/core';
const where = converter({
operators: {
$and: (_, __, children) => children.join(' '),
$eq: ([prop], value) => `${prop} = "${value}"`,
...
}
})
where({
name: 'John'
})
// name = "John"
