Skip to content

Commit

Permalink
dont use Array.from
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 committed Oct 11, 2023
1 parent 473bec8 commit 28d0317
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/m2ts/caption-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,12 @@ Cea708Stream.prototype.handleText = function(i, service, options) {

// Converts an array of bytes to a unicode hex string.
function toHexString(byteArray) {
return Array.from(byteArray, function(byte) {
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
}).join('');
const newArr = [];
byteArray.forEach((byte) => {
newArr.push(('0' + (byte & 0xFF).toString(16)).slice(-2));
});

return newArr.join('');
};

if (isMultiByte) {
Expand Down

0 comments on commit 28d0317

Please sign in to comment.