Files
evento/node_modules/kysely/dist/esm/operation-node/json-path-node.js
2026-03-18 14:55:56 -03:00

24 lines
568 B
JavaScript

/// <reference types="./json-path-node.d.ts" />
import { freeze } from '../util/object-utils.js';
/**
* @internal
*/
export const JSONPathNode = freeze({
is(node) {
return node.kind === 'JSONPathNode';
},
create(inOperator) {
return freeze({
kind: 'JSONPathNode',
inOperator,
pathLegs: freeze([]),
});
},
cloneWithLeg(jsonPathNode, pathLeg) {
return freeze({
...jsonPathNode,
pathLegs: freeze([...jsonPathNode.pathLegs, pathLeg]),
});
},
});