memoize-fs
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,1 +1,6 @@ | ||
### 1.4.1 (2018-07-29) | ||
* fix: run the memoized function once even when called with the same arguments on the same tick | ||
* updated dependencies | ||
### 1.4.0 (2017-08-27) | ||
@@ -2,0 +7,0 @@ |
14
index.js
@@ -41,2 +41,4 @@ 'use strict' | ||
function buildMemoizer (options) { | ||
var promiseCache = {} | ||
// check args | ||
@@ -99,5 +101,9 @@ if (typeof options !== 'object') { | ||
return new Promise(function (resolve, reject) { | ||
var filePath = getCacheFilePathBound(fn, args, optExt) | ||
var filePath = getCacheFilePathBound(fn, args, optExt) | ||
if (promiseCache[filePath]) { | ||
return promiseCache[filePath] | ||
} | ||
promiseCache[filePath] = new Promise(function (resolve, reject) { | ||
function cacheAndReturn () { | ||
@@ -218,2 +224,6 @@ var result | ||
}) | ||
promiseCache[filePath].then(function (result) { | ||
delete promiseCache[filePath] | ||
}) | ||
return promiseCache[filePath] | ||
} | ||
@@ -220,0 +230,0 @@ resolve(memFn) |
{ | ||
"name": "memoize-fs", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "memoize/cache in file system solution for Node.js", | ||
"author": "Boris Diakur <contact@borisdiakur.com> (https://github.com/borisdiakur)", | ||
"scripts": { | ||
"test": "npm run eslint ; mocha test", | ||
"test": "npm run eslint && mocha test", | ||
"eslint": "eslint .", | ||
@@ -26,22 +26,38 @@ "mocha": "mocha --reporter nyan test", | ||
"dependencies": { | ||
"es6-promise": "^4.0.5", | ||
"mkdirp": "^0.5.0", | ||
"rimraf": "^2.4.0", | ||
"shift-parser": "^5.0.7" | ||
"es6-promise": "^4.2.4", | ||
"mkdirp": "^0.5.1", | ||
"rimraf": "^2.6.2", | ||
"shift-parser": "^5.2.4" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.0", | ||
"eslint": "^3.8.1", | ||
"eslint-config-standard": "^6.2.1", | ||
"eslint-plugin-promise": "^3.3.0", | ||
"eslint-plugin-standard": "^2.0.1", | ||
"istanbul": "^0.3.5", | ||
"mocha": "^2.2.5", | ||
"mocha-lcov-reporter": "0.0.2" | ||
"coveralls": "^3.0.2", | ||
"eslint": "^5.2.0", | ||
"eslint-config-standard": "^11.0.0", | ||
"eslint-plugin-import": "^2.13.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"eslint-plugin-promise": "^3.8.0", | ||
"eslint-plugin-standard": "^3.1.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^5.2.0", | ||
"mocha-lcov-reporter": "1.3.0" | ||
}, | ||
"private": false, | ||
"main": "index.js", | ||
"keywords": "memoize, memoizer, cache, memoization, memo, memcached, hashing, storage, persistence, caching, memory, file system, fs", | ||
"keywords": [ | ||
"memoize", | ||
"memoizer", | ||
"cache", | ||
"memoization", | ||
"memo", | ||
"memcached", | ||
"hashing", | ||
"storage", | ||
"persistence", | ||
"caching", | ||
"memory", | ||
"file system", | ||
"fs" | ||
], | ||
"license": "MIT", | ||
"readmeFilename": "README.md" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
20967
10
8
235
1
Updatedes6-promise@^4.2.4
Updatedmkdirp@^0.5.1
Updatedrimraf@^2.6.2
Updatedshift-parser@^5.2.4