MCPcopy
hub / github.com/ether/etherpad / nextText

Method nextText

src/node/utils/padDiff.ts:340–357  ·  view source on GitHub ↗
(numChars: number)

Source from the content-addressed store, hash-verified

338 };
339
340 const nextText = (numChars: number) => {
341 let len = 0;
342 const assem = new StringAssembler();
343 const firstString = linesGet(curLine).substring(curChar);
344 len += firstString.length;
345 assem.append(firstString);
346
347 let lineNum = curLine + 1;
348
349 while (len < numChars) {
350 const nextString = linesGet(lineNum);
351 len += nextString.length;
352 assem.append(nextString);
353 lineNum++;
354 }
355
356 return assem.toString().substring(0, numChars);
357 };
358
359 const cachedStrFunc = (func:Function) => {
360 const cache:MapArrayType<any> = {};

Callers

nothing calls this directly

Calls 3

appendMethod · 0.95
toStringMethod · 0.95
linesGetFunction · 0.85

Tested by

no test coverage detected