Skip to content

Commit 1eaf9ef

Browse files
committed
fix: use indexed for loop instead of for...of for ES5 compatibility
TypeScript with target ES5 doesn't support for...of iteration over Float64Array. Changed back to indexed for loop which is compatible with ES5 while maintaining the same functionality.
1 parent e56f81b commit 1eaf9ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modifiers/colormodifier.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ class ColorModifier extends Modifier {
161161
// Calculate min/max using a loop to avoid stack overflow for large arrays
162162
let minValue = Infinity;
163163
let maxValue = -Infinity;
164-
for (const value of perAtomArray) {
164+
for (let i = 0; i < perAtomArray.length; i++) {
165+
const value = perAtomArray[i];
165166
minValue = Math.min(minValue, value);
166167
maxValue = Math.max(maxValue, value);
167168
}

0 commit comments

Comments
 (0)