UNPKG

mingo

Version:

MongoDB query language for in-memory objects

13 lines (12 loc) 383 B
import { evalExpr } from "../../../core/_internal"; import { assert, isArray, truthy } from "../../../util/_internal"; const $or = (obj, expr, options) => { assert(isArray(expr), "$or expects array of expressions"); const strict = options.useStrictMode; for (const v of expr) if (truthy(evalExpr(obj, v, options), strict)) return true; return false; }; export { $or };