Skip to content

Commit f0cbbe9

Browse files
Fixed Buffer Deprecation warning
I've been seeing a warning for `DeprecationWarning: Buffer() is deprecated due to security and usability issues.`. This fixes that.
1 parent 65e854d commit f0cbbe9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/functions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ const functions = (() => {
581581
// Simply doing `new Buffer` at this point causes Browserify to pull
582582
// in the entire Buffer browser library, which is large and unnecessary.
583583
// Using `global.Buffer` defeats this.
584-
return new global.Buffer(str, 'base64').toString('binary');
584+
return new global.Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line new-cap
585585
};
586586
return atob(str);
587587
}

0 commit comments

Comments
 (0)