MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / concatMultilineString

Function concatMultilineString

src/platform/common/utils.ts:225–239  ·  view source on GitHub ↗
(str: nbformat.MultilineString)

Source from the content-addressed store, hash-verified

223}
224
225export function concatMultilineString(str: nbformat.MultilineString): string {
226 if (Array.isArray(str)) {
227 let result = '';
228 for (let i = 0; i < str.length; i += 1) {
229 const s = str[i];
230 if (i < str.length - 1 && !s.endsWith('\n')) {
231 result = result.concat(`${s}\n`);
232 } else {
233 result = result.concat(s);
234 }
235 }
236 return result;
237 }
238 return str.toString();
239}
240
241export function splitMultilineString(source: nbformat.MultilineString): string[] {
242 // Make sure a multiline string is back the way Jupyter expects it

Callers 6

parseStreamOutputMethod · 0.90
handleStreamMessageMethod · 0.90
translateStreamOutputFunction · 0.90

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected