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

Function nextText

src/static/js/Changeset.ts:1378–1394  ·  view source on GitHub ↗
(numChars: number)

Source from the content-addressed store, hash-verified

1376 };
1377
1378 const nextText = (numChars: number) => {
1379 let len = 0;
1380 const assem = new StringAssembler();
1381 const firstString = linesGet(curLine).substring(curChar);
1382 len += firstString.length;
1383 assem.append(firstString);
1384
1385 let lineNum = curLine + 1;
1386 while (len < numChars) {
1387 const nextString = linesGet(lineNum);
1388 len += nextString.length;
1389 assem.append(nextString);
1390 lineNum++;
1391 }
1392
1393 return assem.toString().substring(0, numChars);
1394 };
1395
1396 const cachedStrFunc = (func: Function) => {
1397 const cache:{

Callers 2

inverseFunction · 0.85

Calls 3

appendMethod · 0.95
toStringMethod · 0.95
linesGetFunction · 0.85

Tested by

no test coverage detected