import { freeze } from '../util/object-utils.js' ; import { OperationNode } from './operation-node.js' ; import { OrderByItemNode } from './order-by-item-node.js' ; export interface OrderByNode extends OperationNode { readonly kind : 'OrderByNode' ; readonly items : ReadonlyArray < OrderByItemNode > ; } internal export const OrderByNode = freeze ( { is ( node ) { return node . kind === 'OrderByNode' ; } , create ( item ) { return freeze ( { kind : 'OrderByNode' , items : freeze ( [ item ] ) , } ) ; } , cloneWithItem ( orderBy , item ) { return freeze ( { ... orderBy , items : freeze ( [ ... orderBy . items , item ] ) , } ) ; } , } ) ;