Socket
Socket
Sign inDemoInstall

@thi.ng/memoize

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/memoize - npm Package Compare versions

Comparing version 1.0.9 to 1.1.0

16

CHANGELOG.md

@@ -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 @@

4

lib/index.js

@@ -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

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