We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 257415e commit 0122595Copy full SHA for 0122595
lib/as.js
@@ -10,9 +10,9 @@ function asBuffer(body, options) {
10
if (Buffer.isBuffer(body)) {
11
ret = body;
12
} else if (typeof body === 'object') {
13
- ret = new Buffer(JSON.stringify(body), options.reqBodyEncoding);
+ ret = Buffer.from(JSON.stringify(body), options.reqBodyEncoding);
14
} else if (typeof body === 'string') {
15
- ret = new Buffer(body, options.reqBodyEncoding);
+ ret = Buffer.from(body, options.reqBodyEncoding);
16
}
17
return ret;
18
0 commit comments