UNPKG

azurite

Version:

An open source Azure Storage API compatible server

31 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const BinaryOperatorNode_1 = tslib_1.__importDefault(require("./BinaryOperatorNode")); const ValueNode_1 = tslib_1.__importDefault(require("./ValueNode")); /** * Represents a logical less than operation between two nodes (the `lt` query operator). * * This is used in queries which resemble the following: * * RowKey lt 'bar' * * In this case, the `LessThanNode` would be the root node, with the left and right nodes * corresponding to the identifier `RowKey` and the constant `bar`, respectively. */ class LessThanNode extends BinaryOperatorNode_1.default { get name() { return `lt`; } evaluate(context) { if (this.left instanceof ValueNode_1.default) { return this.left.compare(context, this.right) < 0; } if (this.right instanceof ValueNode_1.default) { return this.right.compare(context, this.left) > 0; } return this.left.evaluate(context) < this.right.evaluate(context); } } exports.default = LessThanNode; //# sourceMappingURL=LessThanNode.js.map