Comparing version
10
index.js
@@ -68,2 +68,6 @@ 'use strict'; | ||
params.expires *= 1000; | ||
if (typeof params.value === 'function') { | ||
params.value = params.value(); | ||
} | ||
@@ -91,3 +95,3 @@ var store = this.storage[key] = { | ||
*/ | ||
get (key,params) { | ||
get (key,params = {}) { | ||
if (typeof key === 'object') { | ||
@@ -112,2 +116,6 @@ params = key; | ||
} | ||
if (!('value' in params)) { | ||
return null; | ||
} | ||
@@ -114,0 +122,0 @@ return this.set(key,params); |
{ | ||
"name": "cache-io", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Simple memory cache for node js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -69,2 +69,4 @@ [](https://www.npmjs.com/package/cache-io) | ||
Если передать функцию вызывается при необходимости установить кэш | ||
##### expires | ||
@@ -71,0 +73,0 @@ Тип: `integer` |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9843
2.91%159
3.92%192
1.05%0
-100%