Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keyv

Package Overview
Dependencies
Maintainers
1
Versions
61
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 0.2.0 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);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc