* The string a Java / Kotlin return expression builds, when it starts with a * literal: `"owners/ownerDetails"`, `"redirect:/owners/" + owner.getId()` → * `redirect:/owners/${…}`. Null for anything else — a variable, a call.
(expression: string)
| 408 | * `redirect:/owners/${…}`. Null for anything else — a variable, a call. |
| 409 | */ |
| 410 | function springViewString(expression: string): string | null { |
| 411 | let out = ''; |
| 412 | let rest = expression.trim(); |
| 413 | let first = true; |
| 414 | while (rest.length > 0) { |
| 415 | const lit = /^"((?:[^"\\]|\\.)*)"/.exec(rest); |
| 416 | if (lit) { |
| 417 | out += lit[1]!.replace(/\$\{[^}]*\}|\$\w+/g, '${…}'); |
| 418 | rest = rest.slice(lit[0].length).trim(); |
| 419 | } else { |
| 420 | if (first) return null; |
| 421 | const operand = /^[^+]+/.exec(rest); |
| 422 | out += '${…}'; |
| 423 | rest = rest.slice(operand ? operand[0].length : rest.length).trim(); |
| 424 | } |
| 425 | first = false; |
| 426 | if (rest.startsWith('+')) rest = rest.slice(1).trim(); |
| 427 | else break; |
| 428 | } |
| 429 | return first ? null : out; |
| 430 | } |
| 431 | |
| 432 | export async function buildSteps(cg: CodeGraph, projectRoot: string, query: URLSearchParams): Promise<WireStepsPayload> { |
| 433 | const started = Date.now(); |
no test coverage detected