fix: deprecate from "new Buffer" to "Buffer.from" (#6489)

This commit is contained in:
Lucia Sarni
2020-10-08 23:40:46 +02:00
committed by GitHub
parent aa53ec24b8
commit 6c5e91dece

View File

@@ -623,7 +623,7 @@ export const btoa = (str) => {
if (str instanceof Buffer) { if (str instanceof Buffer) {
buffer = str buffer = str
} else { } else {
buffer = new Buffer(str.toString(), "utf-8") buffer = Buffer.from(str.toString(), "utf-8")
} }
return buffer.toString("base64") return buffer.toString("base64")