Skip to content

"const" incorrectly used for some loop iterators in drivers/bbdmx.js #166

@H-s-O

Description

@H-s-O

Today I used patch-package to patch dmx@0.2.5 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/dmx/drivers/bbdmx.js b/node_modules/dmx/drivers/bbdmx.js
index e4df5b5..64c296c 100644
--- a/node_modules/dmx/drivers/bbdmx.js
+++ b/node_modules/dmx/drivers/bbdmx.js
@@ -22,7 +22,7 @@ BBDMX.prototype.sendUniverse = function () {
     let channel;
     let messageBuffer = Buffer.from(UNIVERSE_LEN.toString());
 
-    for (const i = 1; i <= UNIVERSE_LEN; i++) {
+    for (let i = 1; i <= UNIVERSE_LEN; i++) {
       channel = Buffer.from(' ' + this.universe[i]);
       messageBuffer = Buffer.concat([messageBuffer, channel]);
     }
@@ -55,7 +55,7 @@ BBDMX.prototype.update = function (u, extraData) {
 };
 
 BBDMX.prototype.updateAll = function (v) {
-  for (const i = 1; i <= UNIVERSE_LEN; i++) {
+  for (let i = 1; i <= UNIVERSE_LEN; i++) {
     this.universe[i] = v;
   }
 };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions