Skip to content

Commit 6c5e91d

Browse files
authored
fix: deprecate from "new Buffer" to "Buffer.from" (#6489)
1 parent aa53ec2 commit 6c5e91d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ export const btoa = (str) => {
623623
if (str instanceof Buffer) {
624624
buffer = str
625625
} else {
626-
buffer = new Buffer(str.toString(), "utf-8")
626+
buffer = Buffer.from(str.toString(), "utf-8")
627627
}
628628

629629
return buffer.toString("base64")

0 commit comments

Comments
 (0)