Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private extractSortExpression(expr: Algebra.Expression): Algebra.Expression {
const { expressionType, operator } = expr;
if (expressionType !== Algebra.expressionTypes.OPERATOR) { return expr; }
return (operator === 'desc')
? expr.args[0]
: expr;
}