UNPKG

azurite

Version:

An open source Azure Storage API compatible server

31 lines 1.18 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 greater than operation between two nodes (the `gt` query operator). * * This is used in queries which resemble the following: * * RowKey gt 'bar' * * In this case, the `GreaterThanNode` would be the root node, with the left and right nodes * corresponding to the identifier `RowKey` and the constant `bar`, respectively. */ class GreaterThanNode extends BinaryOperatorNode_1.default { get name() { return `gt`; } 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 = GreaterThanNode; //# sourceMappingURL=GreaterThanNode.js.map