UNPKG

@odata2ts/odata-query-objects

Version:

Q-Objects are the magic sauce for the odata-query-builder and allow for renaming and type conversion

43 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QNumberV2Base = void 0; const QBasePath_1 = require("../base/QBasePath"); class QNumberV2Base extends QBasePath_1.QBasePath { constructor() { super(...arguments); this.add = this.plus; this.sub = this.minus; this.mul = this.multiply; this.div = this.divide; this.mod = this.modulo; } formatValue(value) { return String(value); } plus(value) { return this.createNewOperationPath("add" /* NumberFilterOperators.ADDITION */, value); } minus(value) { return this.createNewOperationPath("sub" /* NumberFilterOperators.SUBTRACTION */, value); } multiply(value) { return this.createNewOperationPath("mul" /* NumberFilterOperators.MULTIPLICATION */, value); } divide(value) { return this.createNewOperationPath("div" /* NumberFilterOperators.DIVISION */, value); } modulo(value) { return this.createNewOperationPath("mod" /* NumberFilterOperators.MODULO */, value); } ceiling() { return this.createNewFunctionPath("ceiling" /* NumberFilterFunctions.CEILING */); } floor() { return this.createNewFunctionPath("floor" /* NumberFilterFunctions.FLOOR */); } round() { return this.createNewFunctionPath("round" /* NumberFilterFunctions.ROUND */); } } exports.QNumberV2Base = QNumberV2Base; //# sourceMappingURL=QNumberV2Base.js.map