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

redis-key

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-key - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

10

index.js

@@ -6,3 +6,11 @@ "use strict";

function defaults (separator) {
function defaults (separator, prefix) {
if (prefix) {
return function redisKey() {
var args = Array.prototype.slice.call(arguments);
args.unshift(prefix);
return args.join(separator);
}
}
return function redisKey() {

@@ -9,0 +17,0 @@ return Array.prototype.slice.call(arguments).join(separator)

2

package.json
{
"name": "redis-key",
"version": "1.2.0",
"version": "1.3.0",
"description": "Redis key generator / function argument joiner",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -40,2 +40,10 @@ redis-key

api
---
### .defaults([separator, [prefix]])
* separator - [string] the character[s] to put between the tokens that make up your key (default ':')
* prefix - [string] an additional token that is prefixed to the key
motivation

@@ -42,0 +50,0 @@ ----------

@@ -15,1 +15,9 @@ var test = require('tape');

});
test('custom separator and prefix', function (t) {
var r = rk.defaults('/', 'v1');
t.equal('v1/a/b/c/d', r('a','b','c','d'));
t.end();
});
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