MCPcopy Create free account
hub / github.com/ether/etherpad / getValidRevisionRange

Method getValidRevisionRange

src/node/db/Pad.ts:432–451  ·  view source on GitHub ↗
(startRev: any, endRev:any)

Source from the content-addressed store, hash-verified

430 }
431
432 getValidRevisionRange(startRev: any, endRev:any) {
433 startRev = parseInt(startRev, 10);
434 const head = this.getHeadRevisionNumber();
435 endRev = endRev ? parseInt(endRev, 10) : head;
436
437 if (isNaN(startRev) || startRev < 0 || startRev > head) {
438 startRev = null;
439 }
440
441 if (isNaN(endRev) || endRev < startRev) {
442 endRev = null;
443 } else if (endRev > head) {
444 endRev = head;
445 }
446
447 if (startRev != null && endRev != null) {
448 return {startRev, endRev};
449 }
450 return null;
451 }
452
453 getKeyRevisionNumber(revNum: number) {
454 return Math.floor(revNum / 100) * 100;

Callers 1

constructorMethod · 0.80

Calls 1

getHeadRevisionNumberMethod · 0.95

Tested by

no test coverage detected