Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "keyv", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Simple key/value store with support for multiple backends", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,2 +9,4 @@ # keyv | ||
Keyv is a simple key/value store with support for multiple backends via storage adapters. The Keyv API is basically just a promisified subset of the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) API. Keyv also has TTL support making it suitable as a cache or persistent storage. | ||
## Install | ||
@@ -11,0 +13,0 @@ |
@@ -15,3 +15,3 @@ 'use strict'; | ||
} | ||
if (!store.ttlSupport && Date.now() > data.expires) { | ||
if (!store.ttlSupport && typeof data.expires === 'number' && Date.now() > data.expires) { | ||
this.delete(key); | ||
@@ -31,3 +31,3 @@ return undefined; | ||
} else { | ||
const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : undefined; | ||
const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; | ||
const data = { value, expires }; | ||
@@ -34,0 +34,0 @@ set = store.set(key, data); |
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
7053
20