🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

keyv

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyv - npm Package Compare versions

Comparing version

to
0.2.1

2

package.json
{
"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);