Skip to content

Commit d9ce77f

Browse files
committed
Using Buffer.from instead of constructor form.
1 parent cbbdbba commit d9ce77f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/string.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,10 @@ function buildBase64() {
377377
// istanbul ignore if
378378
if (typeof Buffer !== 'undefined') {
379379
encodeBase64 = function(str) {
380-
return new Buffer(str).toString('base64');
380+
return Buffer.from(str).toString('base64');
381381
};
382382
decodeBase64 = function(str) {
383-
return new Buffer(str, 'base64').toString('utf8');
383+
return Buffer.from(str, 'base64').toString('utf8');
384384
};
385385
return;
386386
}

0 commit comments

Comments
 (0)