@specter/specter
Advanced tools
Comparing version 0.2.3 to 0.3.0
@@ -15,2 +15,4 @@ import SpecterRequest from "./request"; | ||
getNextReqs(): SpecterRequest<any, any, any>[] | undefined; | ||
static parse<H, B>(res: string): SpecterResponse<H, B>; | ||
toString(): string; | ||
} |
@@ -27,3 +27,16 @@ "use strict"; | ||
} | ||
static parse(res) { | ||
const parsed = JSON.parse(res); | ||
const response = new SpecterResponse(parsed.headers, parsed.body); | ||
response.setStatus(parsed.status); | ||
return response; | ||
} | ||
toString() { | ||
return JSON.stringify({ | ||
status: this.status, | ||
headers: this.headers, | ||
body: this.body | ||
}); | ||
} | ||
} | ||
exports.default = SpecterResponse; |
{ | ||
"name": "@specter/specter", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "> TODO: description", | ||
@@ -36,6 +36,6 @@ "author": "Yosuke Furukawa <yosuke.furukawa@gmail.com>", | ||
"isomorphic-unfetch": "3.0.0", | ||
"jest": "25.4.0", | ||
"jest": "25.5.4", | ||
"typescript": "3.8.3" | ||
}, | ||
"gitHead": "f1800febbca4e4159aff760c8efcaa4e6dae2882", | ||
"gitHead": "f4ff1e14fb1a90a37e6d9299d67ab4607dc92d05", | ||
"publishConfig": { | ||
@@ -42,0 +42,0 @@ "access": "public" |
15751
418