mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-07-23 08:37:10 +02:00
Add WumpResponse#buffer
- Added a buffer function - Add `WumpRequest#buffer` in typings
This commit is contained in:
@@ -10,6 +10,10 @@ module.exports = class WumpResponse {
|
|||||||
_addChunk (chunk) {
|
_addChunk (chunk) {
|
||||||
this.body = Buffer.concat([ this.body, chunk ]);
|
this.body = Buffer.concat([ this.body, chunk ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buffer () {
|
||||||
|
return this.body;
|
||||||
|
}
|
||||||
|
|
||||||
text () {
|
text () {
|
||||||
return this.body.toString();
|
return this.body.toString();
|
||||||
@@ -18,4 +22,4 @@ module.exports = class WumpResponse {
|
|||||||
json () {
|
json () {
|
||||||
return JSON.parse(this.body);
|
return JSON.parse(this.body);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user