@pacote/memoize
Advanced tools
Comparing version
@@ -6,3 +6,3 @@ "use strict"; | ||
return { | ||
has: function (key) { return cache.hasOwnProperty(key); }, | ||
has: function (key) { return Object.hasOwnProperty.call(cache, key); }, | ||
get: function (key) { return cache[key]; }, | ||
@@ -9,0 +9,0 @@ set: function (key, value) { |
{ | ||
"name": "@pacote/memoize", | ||
"description": "Memoization function.", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "MIT", | ||
@@ -30,3 +30,3 @@ "author": { | ||
"scripts": {}, | ||
"gitHead": "e0c2792c68e67a63ee7be1fcc2a0fa22a7609534" | ||
"gitHead": "1a075a940e8ca9a1855b3825da3f4e307403f5e4" | ||
} |
type Fn<A extends any[], R> = (...args: A) => R | ||
type Cache<R> = { [key: string]: R } | ||
interface Cache<R> { | ||
[key: string]: R | ||
} | ||
@@ -9,3 +11,3 @@ function createCache<R>() { | ||
return { | ||
has: (key: string) => cache.hasOwnProperty(key), | ||
has: (key: string) => Object.hasOwnProperty.call(cache, key), | ||
@@ -12,0 +14,0 @@ get: (key: string) => cache[key], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
735851
10987.1%11
10%80
2.56%