Comparing version 1.0.6 to 1.1.0
@@ -20,2 +20,4 @@ /// <reference types="node" /> | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
@@ -26,2 +28,4 @@ delete(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
@@ -32,2 +36,4 @@ post(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
@@ -38,2 +44,4 @@ put(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
@@ -44,2 +52,4 @@ patch(url: string, body?: BodyType, options?: RequestOptions): Promise<{ | ||
json: any; | ||
redirected: boolean; | ||
url: string; | ||
}>; | ||
@@ -46,0 +56,0 @@ private _makeRequest; |
@@ -38,2 +38,12 @@ "use strict"; | ||
require('isomorphic-fetch'); | ||
function tryJson(response) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return yield response.json(); | ||
} | ||
catch (e) { | ||
return null; | ||
} | ||
}); | ||
} | ||
class Test { | ||
@@ -82,3 +92,5 @@ constructor(app, defaultOptions = {}) { | ||
status: response.status, | ||
json: yield response.json(), | ||
json: yield tryJson(response), | ||
redirected: response.redirected, | ||
url: response.url | ||
}; | ||
@@ -85,0 +97,0 @@ }); |
{ | ||
"name": "fetchtest", | ||
"description": "A fetch wrapper for express testing", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "dist/lib.js", |
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
8911
186