MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / springViewString

Function springViewString

src/ui-server/api/steps.ts:410–430  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

408 * `redirect:/owners/${…}`. Null for anything else — a variable, a call.
409 */
410function 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
432export async function buildSteps(cg: CodeGraph, projectRoot: string, query: URLSearchParams): Promise<WireStepsPayload> {
433 const started = Date.now();

Callers 1

springMvcRepliesFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected