0.3.0 • Published 9 months ago
@criterium/core v0.3.0
@criterium/core
an agnostic 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"