| 261 | return []; |
| 262 | } |
| 263 | const resolve = reference => { |
| 264 | if (!reference) return null; |
| 265 | if (reference.startsWith('source-ref:')) { |
| 266 | const ref = reference.slice('source-ref:'.length); |
| 267 | return sourceColumns.some(column => column.ref === ref) ? ref : null; |
| 268 | } |
| 269 | const match = reference.match(/^source:(\d+):(.+)$/); |
| 270 | if (!match) return null; |
| 271 | const name = decodeURIComponent(match[2]); |
| 272 | const byIndex = sourceColumns[Number(match[1])]; |
| 273 | if (byIndex?.name === name) return byIndex.ref; |
| 274 | const matches = sourceColumns.filter(column => column.name === name); |
| 275 | return matches.length === 1 ? matches[0].ref : null; |
| 276 | }; |
| 277 | const converted = calculations.map((calc, index) => { |
| 278 | const references = calc.references.length |
| 279 | ? calc.references |
no test coverage detected