(node:73186) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

This commit is contained in:
Hossein Shafagh 2021-03-03 16:02:04 -08:00
parent b118fbbc3b
commit a4e12f0d75
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ function replaceAll(string, find, replace) {
function stringSrc(filename, string) {
let src = require('stream').Readable({objectMode: true});
src._read = function () {
this.push(new gutil.File({cwd: '', base: '', path: filename, contents: new Buffer(string)}));
this.push(new gutil.File({cwd: '', base: '', path: filename, contents: Buffer.from(string)}));
this.push(null);
};
return src;