refactor: use Buffer.from instead of deprecated constructor

This commit is contained in:
Hans 2018-11-15 11:49:20 -08:00 committed by Minko Gechev
parent 17ba2bc450
commit 2b3f9de403
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ exports.istanbulRequireHook = function(code, filename) {
instrumentedCode = instrumentedCode.replace(inlineSourceMapRe, '')
+ '//# sourceMappingURL=data:application/json;base64,'
+ new Buffer(sourceMapGenerator.toString()).toString('base64');
+ Buffer.from(sourceMapGenerator.toString()).toString('base64');
// Keep the consumer from the original source map, because the reports from Istanbul (not
// Constantinople) are already mapped against the code.

View File

@ -55,7 +55,7 @@ export default function(args: ChangelogOptions, logger: logging.Logger) {
const commit = chunk.toString('utf-8')
.replace(/https?:\/\/github.com\/(.*?)\/issues\/(\d+)/g, '@$1#$2');
callback(undefined, new Buffer(commit));
callback(undefined, Buffer.from(commit));
}))
.pipe(conventionalCommitsParser({
headerPattern: /^(\w*)(?:\(([^)]*)\))?: (.*)$/,