code: function wrap (type, index, func) {
    var cache = options.cache;
    var group = cache[type];
    if (group.expire > 0 || group.permanent) {
      return promise(function (resolve, reject) {
        addIf(cache, type, index, {
          done: resolve,
          add: function (done) {
            return func().then(done).catch(reject);
          }
        });
      });
    } else {
      return func();
    }
  }
docs: Define