mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
26
node_modules/memoizee/ext/max.js
generated
vendored
Normal file
26
node_modules/memoizee/ext/max.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Limit cache size, LRU (least recently used) algorithm.
|
||||
|
||||
'use strict';
|
||||
|
||||
var toPosInteger = require('es5-ext/number/to-pos-integer')
|
||||
, lruQueue = require('lru-queue')
|
||||
, extensions = require('../lib/registered-extensions');
|
||||
|
||||
extensions.max = function (max, conf, options) {
|
||||
var postfix, queue, hit;
|
||||
|
||||
max = toPosInteger(max);
|
||||
if (!max) return;
|
||||
|
||||
queue = lruQueue(max);
|
||||
postfix = (options.async && extensions.async) ? 'async' : '';
|
||||
|
||||
conf.on('set' + postfix, hit = function (id) {
|
||||
id = queue.hit(id);
|
||||
if (id === undefined) return;
|
||||
conf.delete(id);
|
||||
});
|
||||
conf.on('get' + postfix, hit);
|
||||
conf.on('delete' + postfix, queue.delete);
|
||||
conf.on('clear' + postfix, queue.clear);
|
||||
};
|
||||
Reference in New Issue
Block a user