Comparing version 0.1.0 to 0.2.0
19
index.js
@@ -20,6 +20,17 @@ 'use strict'; | ||
super.set(key, { | ||
timestamp: opts.maxAge && Date.now() + opts.maxAge, | ||
data: val | ||
}); | ||
if (typeof key === 'object') { | ||
opts = val || {}; | ||
Object.keys(key).forEach(k => { | ||
super.set(k, { | ||
timestamp: opts.maxAge && Date.now() + opts.maxAge, | ||
data: key[k] | ||
}); | ||
}); | ||
} else { | ||
super.set(key, { | ||
timestamp: opts.maxAge && Date.now() + opts.maxAge, | ||
data: val | ||
}); | ||
} | ||
} | ||
@@ -26,0 +37,0 @@ |
{ | ||
"name": "cache-conf", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Simple cache config handling for your app or module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -53,2 +53,6 @@ # cache-conf [![Build Status](https://travis-ci.org/SamVerschueren/cache-conf.svg?branch=master)](https://travis-ci.org/SamVerschueren/cache-conf) | ||
#### set(object, [options]) | ||
Set multiple items at once. | ||
##### options | ||
@@ -55,0 +59,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4352
44
78