Skip to content

Commit

Permalink
Fixed Buffer Deprecation warning (#560)
Browse files Browse the repository at this point in the history
I've been seeing a warning for `DeprecationWarning: Buffer() is deprecated due to security and usability issues.`. This fixes that.
  • Loading branch information
Ramsey-PlexTrac authored Feb 7, 2022
1 parent 65e854d commit f14f1b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ const functions = (() => {
// Simply doing `new Buffer` at this point causes Browserify to pull
// in the entire Buffer browser library, which is large and unnecessary.
// Using `global.Buffer` defeats this.
return new global.Buffer(str, 'base64').toString('binary');
return new global.Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line new-cap
};
return atob(str);
}
Expand Down

0 comments on commit f14f1b3

Please sign in to comment.