MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / getDiffContent

Function getDiffContent

src/shared/utils.ts:74–92  ·  view source on GitHub ↗
(input: string, output: string)

Source from the content-addressed store, hash-verified

72}
73
74export function getDiffContent(input: string, output: string): string | null {
75 let changes: string[] = [];
76 for (const change of diffLines(input, output)) {
77 let lines = change.value.trim().split("\n").slice(0, change.count);
78 if (lines.length === 0) continue;
79 if (change.added) {
80 lines.forEach((line) => {
81 changes.push(bold(green(line)));
82 });
83 }
84 if (change.removed) {
85 lines.forEach((line) => {
86 changes.push(red(line));
87 });
88 }
89 }
90
91 return changes.join("\n");
92}
93
94export const jsClean = (str: string) => {
95 // Clean all non-alphanumberic values except for dashes

Callers 1

writeRoutesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected