UNPKG

spring-filter-query-builder

Version:

<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->

65 lines (64 loc) 2.27 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var Operator = /** @class */ (function () { function Operator(operatorKeyWord, items) { this.operatorKeyWord = operatorKeyWord; this.items = items; } Operator.prototype.toString = function () { return '(' + this.items.map(function (item) { return item.toString(); }).join(" " + this.operatorKeyWord + " ") + ')'; }; return Operator; }()); export { Operator }; var And = /** @class */ (function (_super) { __extends(And, _super); function And(items) { return _super.call(this, 'and', items) || this; } return And; }(Operator)); export { And }; var Or = /** @class */ (function (_super) { __extends(Or, _super); function Or(items) { return _super.call(this, 'or', items) || this; } return Or; }(Operator)); export { Or }; var Not = /** @class */ (function (_super) { __extends(Not, _super); function Not(item) { return _super.call(this, 'not', [item]) || this; } Not.prototype.toString = function () { if (this.items[0] instanceof Operator) { return "" + this.operatorKeyWord + this.items[0].toString(); } return this.operatorKeyWord + "(" + this.items[0].toString() + ")"; }; return Not; }(Operator)); export { Not }; var Exists = /** @class */ (function (_super) { __extends(Exists, _super); function Exists(item) { return _super.call(this, 'exists', [item]) || this; } return Exists; }(Operator)); export { Exists };