Socket
Socket
Sign inDemoInstall

@emotion/weak-memoize

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/weak-memoize - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

src/index.ts

4

dist/declarations/src/index.d.ts

@@ -1,2 +0,2 @@

export * from '../types'
export { default } from '../types'
declare let weakMemoize: <Arg extends object, Return>(func: (arg: Arg) => Return) => (arg: Arg) => Return;
export default weakMemoize;

@@ -6,7 +6,7 @@ 'use strict';

var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
// Use non-null assertion because we just checked that the cache `has` it
// This allows us to remove `undefined` from the return value
return cache.get(arg);

@@ -13,0 +13,0 @@ }

@@ -6,7 +6,7 @@ 'use strict';

var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
// Use non-null assertion because we just checked that the cache `has` it
// This allows us to remove `undefined` from the return value
return cache.get(arg);

@@ -13,0 +13,0 @@ }

var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
// Use non-null assertion because we just checked that the cache `has` it
// This allows us to remove `undefined` from the return value
return cache.get(arg);

@@ -8,0 +8,0 @@ }

{
"name": "@emotion/weak-memoize",
"version": "0.3.1",
"version": "0.4.0",
"description": "A memoization function that uses a WeakMap",
"main": "dist/emotion-weak-memoize.cjs.js",
"module": "dist/emotion-weak-memoize.esm.js",
"types": "types/index.d.ts",
"types": "dist/emotion-weak-memoize.cjs.d.ts",
"license": "MIT",

@@ -18,8 +18,7 @@ "repository": "https://github.com/emotion-js/emotion/tree/main/packages/weak-memoize",

"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
"typescript": "^5.4.5"
},
"files": [
"src",
"dist",
"types/*.d.ts"
"dist"
],

@@ -26,0 +25,0 @@ "exports": {

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