(unitExpr: string, toBase: string, factors: Readonly<Record<string, number>>)
| 352 | } |
| 353 | } |
| 354 | const factorExpr = (unitExpr: string, toBase: string, factors: Readonly<Record<string, number>>) => { |
| 355 | const entries = Object.entries(factors).filter(([, factor]) => Number.isFinite(factor)) |
| 356 | return entries.reduceRight<string>( |
| 357 | (acc, [unit, factor]) => `IIF(${unitExpr} = ${JSON.stringify(unit)}, ${factor}, ${acc})`, |
| 358 | `IIF(${unitExpr} = ${JSON.stringify(toBase)}, 1, 0)` |
| 359 | ) |
| 360 | } |
| 361 | const filter = "filter" in computed ? computed.filter : [] |
| 362 | // Print filter once — `print` mutates the outer `i` parameter counter, so |
| 363 | // re-walking the same filter would double-bump it and desync @v indices. |
no test coverage detected
searching dependent graphs…