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

memoize-cache-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memoize-cache-utils - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

keys-getter.js

@@ -5,3 +5,3 @@ var stringifyKey = require('./stringify-key');

prefix = prefix || '';
func = func || function () { return '_default'; };
func = func || function () { return []; };
return function () {

@@ -8,0 +8,0 @@ var args = Array.prototype.slice.call(arguments);

{
"name": "memoize-cache-utils",
"version": "0.1.0",
"version": "0.1.1",
"description": "Utilities for memoize-cache",

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

@@ -13,3 +13,13 @@ memoize-cache-utils

It takes 2 arguments:
* a function that returns a key (if undefined the default will be a function returning null). Valid outputs are: null, a string or an object. null will default to the key "_default" a string will be used as it is and objects wiil be serialized and hashed.
* an optional prefix. This will be added to the key (default '')
* a function that returns a key (if undefined the default will be a function returning null). Valid outputs are: undefined, null, a string or an object.
* a prefix. It is added to the key (default '').
If the function is undefined, it will be replaced with a function returning "_default".
The following transformation will be applied to the result of the function:
* null will be returned as it is
* a non empty string will be used as it is
* objects/numbers will be serialized and hashed
keys-getter
===========
It is equivalent to key-getter but it expects a function to return an array of keys. It defaults to [] (empty array).

@@ -35,2 +35,6 @@ var assert = require('chai').assert;

it('return default', function () {
var getKey3 = keyGetter();
assert.equal(getKey3('1'), '_default');
});
});

@@ -35,2 +35,6 @@ var assert = require('chai').assert;

it('return default', function () {
var getKey3 = keysGetter();
assert.deepEqual(getKey3('1'), []);
});
});
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