MCPcopy Create free account
hub / github.com/codemix/graph / peg$f248

Function peg$f248

packages/graph/src/grammar.js:2201–2225  ·  view source on GitHub ↗
(expr, direction, nulls)

Source from the content-addressed store, hash-verified

2199 return [head, ...tail.map(t => t[3])];
2200 }
2201 function peg$f248(expr, direction, nulls) {
2202 // Handle backwards compatibility - extract variable/property for simple property access
2203 if (expr && typeof expr === 'object' && expr.type === 'PropertyAccess') {
2204 return {
2205 variable: expr.variable,
2206 property: expr.property,
2207 direction: direction || 'ASC',
2208 ...(nulls && { nulls: nulls })
2209 };
2210 }
2211 // Handle alias (simple identifier)
2212 if (expr && typeof expr === 'object' && expr.type === 'VariableRef') {
2213 return {
2214 alias: expr.variable,
2215 direction: direction || 'ASC',
2216 ...(nulls && { nulls: nulls })
2217 };
2218 }
2219 // For complex expressions
2220 return {
2221 expression: expr,
2222 direction: direction || 'ASC',
2223 ...(nulls && { nulls: nulls })
2224 };
2225 }
2226 function peg$f249() { return 'ASC'; }
2227 function peg$f250() { return 'ASC'; }
2228 function peg$f251() { return 'DESC'; }

Callers 1

peg$parseOrderItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected