MCPcopy Index your code
hub / github.com/pomber/code-surfer / getCodeList

Function getCodeList

packs/step-parser/src/step-parser.ts:111–128  ·  view source on GitHub ↗
(
  inputSteps: {
    code: string;
    lang?: string | undefined;
  }[]
)

Source from the content-addressed store, hash-verified

109}
110
111function getCodeList(
112 inputSteps: {
113 code: string;
114 lang?: string | undefined;
115 }[]
116) {
117 const firstLang = inputSteps[0].lang;
118 if (firstLang === "diff") {
119 return inputSteps.map(s => s.code);
120 }
121
122 let prevCode = "";
123 return inputSteps.map(({ code, lang }) => {
124 let stepCode = lang === "diff" ? applyPatch(prevCode, code) : code;
125 prevCode = stepCode;
126 return stepCode;
127 });
128}
129
130function splitIntoColumns(
131 types: string[],

Callers 1

parseStepsFunction · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected