Socket
Socket
Sign inDemoInstall

keyv

Package Overview
Dependencies
1
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1

4

package.json
{
"name": "keyv",
"version": "4.0.0",
"version": "4.0.1",
"description": "Simple key-value storage with support for multiple backends",

@@ -47,4 +47,4 @@ "main": "src/index.js",

"timekeeper": "^2.0.0",
"xo": "^0.24.0"
"xo": "^0.25.3"
}
}

@@ -54,6 +54,6 @@ 'use strict';

get(key, opts) {
key = this._getKeyPrefix(key);
const keyPrefixed = this._getKeyPrefix(key);
const { store } = this.opts;
return Promise.resolve()
.then(() => store.get(key))
.then(() => store.get(keyPrefixed))
.then(data => {

@@ -77,3 +77,3 @@ return (typeof data === 'string') ? this.opts.deserialize(data) : data;

set(key, value, ttl) {
key = this._getKeyPrefix(key);
const keyPrefixed = this._getKeyPrefix(key);
if (typeof ttl === 'undefined') {

@@ -95,3 +95,3 @@ ttl = this.opts.ttl;

})
.then(value => store.set(key, value, ttl))
.then(value => store.set(keyPrefixed, value, ttl))
.then(() => true);

@@ -101,6 +101,6 @@ }

delete(key) {
key = this._getKeyPrefix(key);
const keyPrefixed = this._getKeyPrefix(key);
const { store } = this.opts;
return Promise.resolve()
.then(() => store.delete(key));
.then(() => store.delete(keyPrefixed));
}

@@ -107,0 +107,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc