@thi.ng/memoize
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -6,2 +6,18 @@ # Change Log | ||
# [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/memoize@1.0.9...@thi.ng/memoize@1.1.0) (2019-07-07) | ||
### Bug Fixes | ||
* **memoize:** return type memoize1() ([c0dafb9](https://github.com/thi-ng/umbrella/commit/c0dafb9)) | ||
### Features | ||
* **memoize:** enable TS strict compiler flags (refactor) ([a08cc69](https://github.com/thi-ng/umbrella/commit/a08cc69)) | ||
## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/memoize@1.0.8...@thi.ng/memoize@1.0.9) (2019-05-22) | ||
@@ -8,0 +24,0 @@ |
@@ -21,3 +21,5 @@ 'use strict'; | ||
let res; | ||
return cache.has(x) ? cache.get(x) : (cache.set(x, (res = fn(x))), res); | ||
return cache.has(x) | ||
? cache.get(x) | ||
: (cache.set(x, (res = fn(x))), res); | ||
}; | ||
@@ -24,0 +26,0 @@ } |
@@ -23,3 +23,5 @@ (function (global, factory) { | ||
let res; | ||
return cache.has(x) ? cache.get(x) : (cache.set(x, (res = fn(x))), res); | ||
return cache.has(x) | ||
? cache.get(x) | ||
: (cache.set(x, (res = fn(x))), res); | ||
}; | ||
@@ -26,0 +28,0 @@ } |
@@ -13,2 +13,2 @@ import { Fn1, MapLike } from "./api"; | ||
*/ | ||
export declare function memoize1<A, B>(fn: Fn1<A, B>, cache?: MapLike<A, B>): (x: A) => any; | ||
export declare function memoize1<A, B>(fn: Fn1<A, B>, cache?: MapLike<A, B>): (x: A) => B; |
@@ -16,4 +16,6 @@ /** | ||
let res; | ||
return cache.has(x) ? cache.get(x) : (cache.set(x, (res = fn(x))), res); | ||
return cache.has(x) | ||
? cache.get(x) | ||
: (cache.set(x, (res = fn(x))), res); | ||
}; | ||
} |
{ | ||
"name": "@thi.ng/memoize", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Function memoization with configurable caches", | ||
@@ -28,10 +28,10 @@ "module": "./index.js", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.13.7", | ||
"@types/node": "^12.0.8", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.0.0", | ||
"typedoc": "^0.14.2", | ||
"typescript": "^3.4.5" | ||
"typescript": "^3.5.2" | ||
}, | ||
"dependencies": { | ||
"@thi.ng/api": "^6.2.0" | ||
"@thi.ng/api": "^6.3.0" | ||
}, | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
"sideEffects": false, | ||
"gitHead": "5a4226d52724f320fb25656f08addb2825375fee" | ||
"gitHead": "efa9fdd61dd4ad2187cefe0a26df3bf2baade24b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29558
221
Updated@thi.ng/api@^6.3.0