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