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

memoizee

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memoizee - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

24

lib/configure-map.js

@@ -94,18 +94,16 @@ 'use strict';

memoized = function (arg) {
var result, args = arguments;
if (resolve) {
args = resolve(arguments);
arg = args[0];
var result, args = arguments, id;
if (resolve) args = resolve(arguments);
id = String(args[0]);
if (hasOwnProperty.call(cache, id)) {
if (getListeners) conf.emit('get', id, args, this);
return cache[id];
}
if (hasOwnProperty.call(cache, arg)) {
if (getListeners) conf.emit('get', arg, args, this);
return cache[arg];
}
if (args.length === 1) result = call.call(original, this, arg);
if (args.length === 1) result = call.call(original, this, args[0]);
else result = apply.call(original, this, args);
if (hasOwnProperty.call(cache, arg)) {
if (hasOwnProperty.call(cache, id)) {
throw customError("Circular invocation", 'CIRCULAR_INVOCATION');
}
cache[arg] = result;
if (setListeners) conf.emit('set', arg);
cache[id] = result;
if (setListeners) conf.emit('set', id);
return result;

@@ -120,3 +118,3 @@ };

if (get) return get(args);
return args[0];
return String(args[0]);
},

@@ -123,0 +121,0 @@ has: function (id) { return hasOwnProperty.call(cache, id); },

{
"name": "memoizee",
"version": "0.3.4",
"version": "0.3.5",
"description": "Memoize/cache",

@@ -5,0 +5,0 @@ "author": "Mariusz Nowak <medikoo@medikoo.com> (http://www.medikoo.com/)",

@@ -224,2 +224,13 @@ 'use strict';

});
},
"Primitive null arg case": function (a, d) {
var x = {}, mfn = memoize(function f(id, cb) { cb(null, x); }, {
async: true,
primitive: true
});
mfn(null, function (err, res) {
a.deep([err, res], [null, x], "Args");
d();
});
}

@@ -226,0 +237,0 @@ },

Sorry, the diff of this file is not supported yet

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