UNPKG

mingo

Version:

MongoDB query language for in-memory objects

13 lines (12 loc) 397 B
import { computeValue } from "../../../core/_internal"; import { isNil } from "../../../util"; import { errExpectNumber } from "../_internal"; const $log10 = (obj, expr, options) => { const n = computeValue(obj, expr, null, options); if (isNil(n)) return null; if (typeof n === "number") return Math.log10(n); return errExpectNumber(options.failOnError, "$log10"); }; export { $log10 };