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

@keyvhq/redis

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keyvhq/redis - npm Package Compare versions

Comparing version

to
1.6.28

LICENSE.md

5

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/microlinkhq/keyv",
"version": "1.6.26",
"version": "1.6.28",
"main": "src/index.js",

@@ -65,3 +65,4 @@ "author": {

},
"types": "./src/index.d.ts"
"types": "./src/index.d.ts",
"gitHead": "69f95c41789d2a7fb83fbcc80e120e9f2a15274c"
}

6

README.md

@@ -19,5 +19,3 @@ # @keyvhq/redis [<img width="100" align="right" src="https://keyv.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv)

const keyv = new Keyv({
store: new KeyvRedis('redis://user:pass@localhost:6379')
})
const keyv = new Keyv({ store: new KeyvRedis('redis://user:pass@localhost:6379') })

@@ -33,3 +31,3 @@ keyv.on('error', handleConnectionError)

const keyv = new Keyv({
const keyv = new Keyv({
store: new KeyvRedis('redis://user:pass@localhost:6379', {

@@ -36,0 +34,0 @@ disable_resubscribing: true

@@ -7,7 +7,11 @@ 'use strict'

const normalizeOptions = (...args) => Object.assign({ emitErrors: true }, ...args)
const normalizeOptions = (...args) =>
Object.assign({ emitErrors: true }, ...args)
const normalizeArguments = (input, options) => {
if (input instanceof Redis) return [input, normalizeOptions(options)]
const { uri, ...opts } = Object.assign(typeof input === 'string' ? { uri: input } : input, options)
const { uri, ...opts } = Object.assign(
typeof input === 'string' ? { uri: input } : input,
options
)
const normalizedOpts = normalizeOptions(opts)

@@ -38,3 +42,5 @@ return [new Redis(uri, normalizedOpts), normalizedOpts]

async set (key, value, ttl) {
return typeof ttl === 'number' ? this.redis.set(key, value, 'PX', ttl) : this.redis.set(key, value)
return typeof ttl === 'number'
? this.redis.set(key, value, 'PX', ttl)
: this.redis.set(key, value)
}

@@ -41,0 +47,0 @@