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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. 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] === opening) {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cafe-utility",
3
- "version": "4.11.0",
3
+ "version": "4.11.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "exports": {