* Processes a non-merge operation by setting the field value at the specified alias path
(
op: Extract<SelectOp, { kind: `field` }>,
namespacedRow: NamespacedRow,
selectResults: Record<string, any>,
)
| 97 | * Processes a non-merge operation by setting the field value at the specified alias path |
| 98 | */ |
| 99 | function processNonMergeOp( |
| 100 | op: Extract<SelectOp, { kind: `field` }>, |
| 101 | namespacedRow: NamespacedRow, |
| 102 | selectResults: Record<string, any>, |
| 103 | ): void { |
| 104 | // Support nested alias paths like "meta.author.name" |
| 105 | const path = op.alias.split(`.`) |
| 106 | assertSafeAliasSegments(path) |
| 107 | if (path.length === 1) { |
| 108 | selectResults[op.alias] = op.compiled(namespacedRow) |
| 109 | } else { |
| 110 | let cursor: any = selectResults |
| 111 | for (let i = 0; i < path.length - 1; i++) { |
| 112 | const seg = path[i]! |
| 113 | const next = cursor[seg] |
| 114 | if (next == null || typeof next !== `object`) { |
| 115 | cursor[seg] = {} |
| 116 | } |
| 117 | cursor = cursor[seg] |
| 118 | } |
| 119 | cursor[path[path.length - 1]!] = unwrapVal(op.compiled(namespacedRow)) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Processes a single row to generate select results |
no test coverage detected