(
inputSteps: {
code: string;
lang?: string | undefined;
}[]
)
| 109 | } |
| 110 | |
| 111 | function 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 | |
| 130 | function splitIntoColumns( |
| 131 | types: string[], |