UNPKG

@qrvey/formula-lang

Version:

QFormula support for qrvey projects

39 lines 853 B
import { AST_PRIMITIVES } from '../constants'; import { isNumberParam } from '../utils'; /** * `ABS` Returns the absolute value of a number. */ export const ABS = { identifier: 'ABS', parameters: [ { identifier: 'VALUE', optional: false, expectedPrimitive: AST_PRIMITIVES.NUMBER, validator: [isNumberParam], }, ], transpiler: { elasticsearch, snowflake, redshift, postgresql, }, primitiveResult: AST_PRIMITIVES.NUMBER, }; function elasticsearch(value) { return `Math.abs(${value})`; } function SQL(value) { return `ABS(${value})`; } function snowflake(value) { return SQL(value); } function redshift(value) { return SQL(value); } function postgresql(value) { return SQL(value); } //# sourceMappingURL=abs.js.map