make-fetch-happen
Advanced tools
Comparing version 2.2.4 to 2.2.5
15
cache.js
@@ -5,3 +5,2 @@ 'use strict' | ||
const fetch = require('node-fetch') | ||
const fs = require('fs') | ||
const pipe = require('mississippi').pipe | ||
@@ -61,11 +60,3 @@ const ssri = require('ssri') | ||
} | ||
return new this.Promise((resolve, reject) => { | ||
fs.stat(info.path, (err, stat) => { | ||
if (err) { | ||
return reject(err) | ||
} else { | ||
return resolve(stat) | ||
} | ||
}) | ||
}).then(stat => { | ||
return Promise.resolve().then(() => { | ||
const cachePath = this._path | ||
@@ -80,3 +71,3 @@ let disturbed = false | ||
disturbed = true | ||
if (stat.size > MAX_MEM_SIZE) { | ||
if (info.size > MAX_MEM_SIZE) { | ||
pipe( | ||
@@ -105,3 +96,3 @@ cacache.get.stream.byDigest(cachePath, info.integrity), | ||
status: 200, | ||
size: stat.size | ||
size: info.size | ||
}) | ||
@@ -108,0 +99,0 @@ }).catch(err => { |
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.2.5"></a> | ||
## [2.2.5](https://github.com/zkat/make-fetch-happen/compare/v2.2.4...v2.2.5) (2017-04-23) | ||
### Bug Fixes | ||
* **deps:** bump cacache and use its size feature ([926c1d3](https://github.com/zkat/make-fetch-happen/commit/926c1d3)) | ||
<a name="2.2.4"></a> | ||
@@ -7,0 +17,0 @@ ## [2.2.4](https://github.com/zkat/make-fetch-happen/compare/v2.2.3...v2.2.4) (2017-04-18) |
{ | ||
"name": "make-fetch-happen", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "Opinionated, caching, retrying fetch client", | ||
@@ -40,3 +40,3 @@ "main": "index.js", | ||
"agentkeepalive": "^3.1.0", | ||
"cacache": "^7.0.5", | ||
"cacache": "^8.0.0", | ||
"http-cache-semantics": "^3.7.3", | ||
@@ -43,0 +43,0 @@ "http-proxy-agent": "^1.0.0", |
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
2532397
7
42172
+ Addedcacache@8.0.0(transitive)
- Removedcacache@7.1.0(transitive)
Updatedcacache@^8.0.0