MCPcopy
hub / github.com/philc/vimium / rotate

Method rotate

lib/utils.js:365–377  ·  view source on GitHub ↗
(force)

Source from the content-addressed store, hash-verified

363 }
364
365 rotate(force) {
366 if (force == null) force = false;
367 Utils.nextTick(() => {
368 if (
369 force || (this.maxEntries < Object.keys(this.cache).length) ||
370 (this.expiry < (new Date() - this.lastRotation))
371 ) {
372 this.lastRotation = new Date();
373 this.previous = this.cache;
374 return this.cache = {};
375 }
376 });
377 }
378
379 clear() {
380 this.rotate(true);

Callers 4

hasMethod · 0.95
setMethod · 0.95
getMethod · 0.95
clearMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected