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

@bothrs/util

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bothrs/util - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

13

memo.ts

@@ -8,6 +8,3 @@ /**

*/
export function memo<T extends (...args: any[]) => any>(
func: T,
timeout = 0
): (...args: Parameters<T>) => ReturnType<T> {
export function memo<T extends (...args: any[]) => any>(func: T, timeout = 0) {
const cache: { [key: string]: ReturnType<T> | null } = {}

@@ -29,4 +26,4 @@ const f = function (...[a, b, c]: Parameters<T>): ReturnType<T> {

(cache[JSON.stringify(key)] = value)
// @ts-ignore
f.reset = (a, b, c) => (cache[JSON.stringify([a, b, c])] = null)
f.reset = (...[a, b, c]: Parameters<T>) =>
(cache[JSON.stringify([a, b, c])] = null)
return f

@@ -68,5 +65,5 @@ }

(cache[JSON.stringify([a, b, c])] = value)
// @ts-ignore
f.reset = (a, b, c) => (cache[JSON.stringify([a, b, c])] = null)
f.reset = (...[a, b, c]: Parameters<T>) =>
(cache[JSON.stringify([a, b, c])] = null)
return f
}
{
"name": "@bothrs/util",
"version": "2.0.0",
"version": "2.0.1",
"description": "Common helper functions",

@@ -17,10 +17,9 @@ "license": "MIT",

"devDependencies": {
"@types/node": "^13.11.1",
"@types/node-fetch": "^2.5.4",
"node-fetch": "^2.6.0",
"@types/node": "14",
"@types/node-fetch": "2",
"node-fetch": "^2.6.1",
"prettier": "2",
"rollup-plugin-multi-entry": "^2.1.0",
"rollup-plugin-typescript2": "^0.25.3",
"tslib": "^1.10.0",
"typescript": "^3.7.4"
"rollup-plugin-typescript2": "^0.30.0",
"typescript": "4"
},

@@ -27,0 +26,0 @@ "engines": {

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