| 1468 | : never; |
| 1469 | |
| 1470 | function appendOrderDirection( |
| 1471 | steps: readonly Step<any>[], |
| 1472 | orderDirection: { |
| 1473 | key?: string; |
| 1474 | direction: OrderDirection; |
| 1475 | }, |
| 1476 | ) { |
| 1477 | const nextSteps = [...steps]; |
| 1478 | const orderStep = |
| 1479 | nextSteps.length > 0 && nextSteps[nextSteps.length - 1] instanceof OrderStep |
| 1480 | ? nextSteps[nextSteps.length - 1] |
| 1481 | : undefined; |
| 1482 | |
| 1483 | if (!orderStep) { |
| 1484 | nextSteps.push(new OrderStep({ directions: [orderDirection] })); |
| 1485 | return nextSteps; |
| 1486 | } |
| 1487 | |
| 1488 | nextSteps[nextSteps.length - 1] = orderStep.clone({ |
| 1489 | directions: [...orderStep.config.directions, orderDirection], |
| 1490 | }); |
| 1491 | |
| 1492 | return nextSteps; |
| 1493 | } |
| 1494 | |
| 1495 | type ResolveTraversalPathProperty< |
| 1496 | TSchema extends GraphSchema, |