Skip to content

Commit 3eebcaf

Browse files
committed
Use Buffer.from instead of deprecated new Buffer
1 parent e153153 commit 3eebcaf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

KaitaiStream.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,7 @@ KaitaiStream.bytesToStr = function(arr, encoding) {
582582
case 'ucs-2':
583583
case 'utf16le':
584584
case 'utf-16le':
585-
return new Buffer(arr).toString(encoding);
586-
break;
585+
return Buffer.from(arr).toString(encoding);
587586
default:
588587
// unsupported encoding, we'll have to resort to iconv-lite
589588
if (typeof KaitaiStream.iconvlite === 'undefined')

0 commit comments

Comments
 (0)