Socket
Socket
Sign inDemoInstall

mem

Package Overview
Dependencies
3
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.0.0 to 9.0.1

8

dist/index.js
import mimicFn from 'mimic-fn';
import mapAgeCleaner from 'map-age-cleaner';
const decoratorInstanceMap = new WeakMap();
const cacheStore = new WeakMap();

@@ -83,2 +82,3 @@ /**

export function memDecorator(options = {}) {
const instanceMap = new WeakMap();
return (target, propertyKey, descriptor) => {

@@ -92,8 +92,8 @@ const input = target[propertyKey]; // eslint-disable-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access

descriptor.get = function () {
if (!decoratorInstanceMap.has(this)) {
if (!instanceMap.has(this)) {
const value = mem(input, options);
decoratorInstanceMap.set(this, value);
instanceMap.set(this, value);
return value;
}
return decoratorInstanceMap.get(this);
return instanceMap.get(this);
};

@@ -100,0 +100,0 @@ };

{
"name": "mem",
"version": "9.0.0",
"version": "9.0.1",
"description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input",

@@ -5,0 +5,0 @@ "license": "MIT",

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