From 28d03178503763cb6626b9c2f4f4aec9905e21b3 Mon Sep 17 00:00:00 2001 From: wseymour15 Date: Wed, 11 Oct 2023 15:56:20 -0500 Subject: [PATCH] dont use Array.from --- lib/m2ts/caption-stream.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/m2ts/caption-stream.js b/lib/m2ts/caption-stream.js index 4b2059b5..a2d3d9b0 100644 --- a/lib/m2ts/caption-stream.js +++ b/lib/m2ts/caption-stream.js @@ -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) {