UNPKG

oidc-lib

Version:

A library for creating OIDC Service Providers

23 lines (20 loc) 602 B
// node-cache module.exports = cacheFactory; function cacheFactory(id, options){ var _cache = {}; var _cacheId = id; var _stdTTL = options.stdTTL ? options.stdTTL : 3600; var _checkperiod = options.checkperiod ? options.checkperiod :120; Object.defineProperty(this, "set", { value: function(name, value, timeout) { name = _cacheId + '-' + name; localStorage.setItem(name, value); } }); Object.defineProperty(this, "get", { value: function(name) { name = _cacheId + '-' + name; return localStorage.getItem(name); } }); }