UNPKG

sphinxql

Version:

SphinxQL query builder for Node.JS. Supports Sphinx search(2.x and 3.x) and Manticore search

33 lines 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LimitExprStatement = (function () { function LimitExprStatement(offset, size) { if (offset === void 0) { offset = 0; } if (size === void 0) { size = 5; } this.setOffset(offset); this.setSize(size); } LimitExprStatement.prototype.build = function () { var expression = ''; if (this.offset > 0) { expression += this.offset + ", "; } expression += "" + this.size; return expression; }; LimitExprStatement.prototype.setOffset = function (offset) { if (offset < 0) { throw Error('Offset must greater or equal to zero'); } this.offset = offset; }; LimitExprStatement.prototype.setSize = function (size) { if (size < 1) { throw Error('Size of results must be greater than zero'); } this.size = size; }; return LimitExprStatement; }()); exports.default = LimitExprStatement; //# sourceMappingURL=LimitExprStatement.js.map