import { ArrayItemType } from '../util/type-utils.js' ; import { freeze } from '../util/object-utils.js' ; import { OperationNode } from './operation-node.js' ; export const OPERATORS = [ '=' , '==' , '!=' , '<>' , '>' , '>=' , '<' , '<=' , 'in' , 'not in' , 'is' , 'is not' , 'like' , 'not like' , 'ilike' , 'not ilike' , '@>' , '<@' , '?' , '?' , '?&' , '!<' , '!>' , '<=>' , '!~' , '~' , '~*' , '!~*' , 'exists' , 'not exists' , '&&' , '||' , '@@' , '@@@' , '!!' , '<->' , ] as const ; export type Operator = ArrayItemType < typeof OPERATORS > ; export interface OperatorNode extends OperationNode { readonly kind : 'OperatorNode' ; readonly operator : Operator ; } internal export const OperatorNode = freeze ( { is ( node ) { return node . kind === 'OperatorNode' ; } , create ( operator ) { return freeze ( { kind : 'OperatorNode' , operator , } ) ; } , } ) ;