UNPKG

@allgemein/expressions

Version:
25 lines 738 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LeDesc = void 0; exports.Le = Le; const _ = require("lodash"); const KeyDesc_1 = require("./KeyDesc"); const OpDesc_1 = require("./OpDesc"); class LeDesc extends OpDesc_1.OpDesc { constructor(key, value) { super(key, value); this.type = 'le'; } lookup(source) { const value = this.value instanceof KeyDesc_1.KeyDesc ? source[this.value.key] : _.clone(this.value.value); const key = this.key; return function (target) { return target[key] <= value; }; } } exports.LeDesc = LeDesc; function Le(key, value) { return new LeDesc(key, value); } //# sourceMappingURL=LeDesc.js.map