New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

exp-fetch

Package Overview
Dependencies
Maintainers
9
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exp-fetch - npm Package Compare versions

Comparing version

to
3.2.0

12

index.js

@@ -103,5 +103,13 @@ "use strict";

}
var error = errorOnRemoteError ? new VError("%s yielded %s (%s)", url, res.statusCode, util.inspect(content)) : null;
errorAge = maxAgeFn(errorAge, cacheKey, res, content);
return resolvedCallback(error, cacheValueFn(undefined, res.headers, res.statusCode), errorAge);
if (errorOnRemoteError) {
var error = new VError("%s yielded %s (%s)", url, res.statusCode, util.inspect(content));
error.statusCode = res.statusCode;
return resolvedCallback(error, cacheValueFn(undefined, res.headers, res.statusCode), errorAge);
}
return resolvedCallback(null, cacheValueFn(undefined, res.headers, res.statusCode), errorAge);
}

@@ -108,0 +116,0 @@

12

package.json
{
"name": "exp-fetch",
"version": "3.1.0",
"version": "3.2.0",
"description": "A small pluggable fetch lib",

@@ -14,3 +14,3 @@ "main": "index.js",

"type": "git",
"url": "git://github.com/ExpressenAB/exp-fetch.git"
"url": "git@github.com:BonnierNews/exp-fetch.git"
},

@@ -21,8 +21,8 @@ "keywords": [

],
"author": "AB Kvällstidningen Expressen",
"author": "Bonnier News",
"license": "MIT",
"bugs": {
"url": "https://github.com/ExpressenAB/exp-fetch/issues"
"url": "https://github.com/BonnierNews/exp-fetch/issues"
},
"homepage": "https://github.com/ExpressenAB/exp-fetch",
"homepage": "https://github.com/BonnierNews/exp-fetch",
"devDependencies": {

@@ -32,3 +32,3 @@ "chai": "^4.1.2",

"mocha": "^5.2.0",
"nock": "^9.6.1"
"nock": "^11.9.0"
},

@@ -35,0 +35,0 @@ "dependencies": {

fetch
=====
[![Build Status](https://travis-ci.org/ExpressenAB/exp-fetch.svg?branch=master)](https://travis-ci.org/ExpressenAB/exp-fetch)
[![Build Status](https://travis-ci.org/BonnierNews/exp-fetch.svg?branch=master)](https://travis-ci.org/BonnierNews/exp-fetch)

@@ -5,0 +5,0 @@ A small and pluggable lib to fetch a resource and cache the result.

@@ -495,2 +495,3 @@ "use strict";

done();
return [200, null];
});

@@ -568,2 +569,14 @@ fetch(host + path);

describe("error status codes", function () {
it("should pass on the error status code", function (done) {
var fetch = fetchBuilder().fetch;
fake.get(path).reply(500, "Internal Server Error");
fetch(host + path, function (err) {
should.exist(err);
err.statusCode.should.eql(500);
done();
});
});
});
describe("Global header", function () {

@@ -570,0 +583,0 @@ const fetch = fetchBuilder({

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet