Skip to content

Commit 2b3f9de

Browse files
hanslmgechev
authored andcommitted
refactor: use Buffer.from instead of deprecated constructor
1 parent 17ba2bc commit 2b3f9de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/istanbul-local.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports.istanbulRequireHook = function(code, filename) {
4646

4747
instrumentedCode = instrumentedCode.replace(inlineSourceMapRe, '')
4848
+ '//# sourceMappingURL=data:application/json;base64,'
49-
+ new Buffer(sourceMapGenerator.toString()).toString('base64');
49+
+ Buffer.from(sourceMapGenerator.toString()).toString('base64');
5050

5151
// Keep the consumer from the original source map, because the reports from Istanbul (not
5252
// Constantinople) are already mapped against the code.

scripts/changelog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function(args: ChangelogOptions, logger: logging.Logger) {
5555
const commit = chunk.toString('utf-8')
5656
.replace(/https?:\/\/github.com\/(.*?)\/issues\/(\d+)/g, '@$1#$2');
5757

58-
callback(undefined, new Buffer(commit));
58+
callback(undefined, Buffer.from(commit));
5959
}))
6060
.pipe(conventionalCommitsParser({
6161
headerPattern: /^(\w*)(?:\(([^)]*)\))?: (.*)$/,

0 commit comments

Comments
 (0)