From 512ee8d11d4e0ee02d22b10c5ea9cf40f1b90ffc Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Sun, 30 Apr 2023 20:03:50 -0500 Subject: [PATCH] Let's try mozilla's fixedCharAt function --- commands/drawDesign.cjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/drawDesign.cjs b/commands/drawDesign.cjs index 0bf4e0e..f9244a2 100644 --- a/commands/drawDesign.cjs +++ b/commands/drawDesign.cjs @@ -217,8 +217,9 @@ function charIterate(input) { let temp = input.split(''); for (let i = 0; i < stringLength; ++i) { let compareString = temp.join(""); - console.log(surrogatePairs.exec(compareString)); - if (surrogatePairs.exec(compareString).index == i) { + console.log(surrogatePairs.exec(compareString), compareString); + let eval = surrogatePairs.exec(compareString).index; + if (eval != null && eval == i) { stringLength--; console.log("Decreasing stringLength variable to", stringLength); }