Skip to content

Commit 4a1b441

Browse files
committed
Use Buffer.from instead of deprecated new Buffer
1 parent 43c73d1 commit 4a1b441

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

KaitaiStream.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,7 @@ KaitaiStream.bytesToStr = function(arr, encoding) {
622622
case 'ucs-2':
623623
case 'utf16le':
624624
case 'utf-16le':
625-
return new Buffer(arr).toString(encoding);
626-
break;
625+
return Buffer.from(arr).toString(encoding);
627626
default:
628627
// unsupported encoding, we'll have to resort to iconv-lite
629628
if (typeof KaitaiStream.iconvlite === 'undefined')

0 commit comments

Comments
 (0)