MCPcopy Index your code
hub / github.com/ether/etherpad / _getChangesetsInBulk

Method _getChangesetsInBulk

src/node/utils/padDiff.ts:104–121  ·  view source on GitHub ↗
(startRev: any, count: any)

Source from the content-addressed store, hash-verified

102 return newAText;
103 }
104 async _getChangesetsInBulk(startRev: any, count: any) {
105 // find out which revisions we need
106 const revisions = [];
107 for (let i = startRev; i < (startRev + count) && i <= this._pad.head; i++) {
108 revisions.push(i);
109 }
110
111 // get all needed revisions (in parallel)
112 const changesets:any[] = [];
113 const authors: any[] = [];
114 await Promise.all(revisions.map((rev) => this._pad.getRevision(rev).then((revision) => {
115 const arrayNum = rev - startRev;
116 changesets[arrayNum] = revision.changeset;
117 authors[arrayNum] = revision.meta.author;
118 })));
119
120 return {changesets, authors};
121 }
122 _addAuthors(authors: PadAuthor[]){
123 // add to array if not in the array
124 authors.forEach((author) => {

Callers 1

_createDiffAtextMethod · 0.95

Calls 3

pushMethod · 0.80
mapMethod · 0.80
getRevisionMethod · 0.80

Tested by

no test coverage detected