%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/old/usr/lib/node_modules/hexo/lib/plugins/helper/
Upload File :
Create Path :
Current File : //data/old/usr/lib/node_modules/hexo/lib/plugins/helper/fragment_cache.js

'use strict';
const { Cache } = require('hexo-util');

module.exports = ctx => {
  const cache = new Cache();

  // reset cache for watch mode
  ctx.on('generateBefore', () => { cache.flush(); });

  return function fragmentCache(id, fn) {
    if (this.cache) return cache.apply(id, fn);

    const result = fn();

    cache.set(id, result);
    return result;
  };
};

Zerion Mini Shell 1.0