cafe-utility 4.11.0 → 4.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -934,12 +934,12 @@ function csvEscape(string) {
|
|
|
934
934
|
function findWeightedPair(string, start = 0, opening = '{', closing = '}') {
|
|
935
935
|
let weight = 1
|
|
936
936
|
for (let i = start; i < string.length; i++) {
|
|
937
|
-
if (string[i] ===
|
|
938
|
-
weight++
|
|
939
|
-
} else if (string[i] === closing) {
|
|
937
|
+
if (string[i] === closing) {
|
|
940
938
|
if (--weight === 0) {
|
|
941
939
|
return i
|
|
942
940
|
}
|
|
941
|
+
} else if (string[i] === opening) {
|
|
942
|
+
weight++
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
return -1
|