balanced-match 0.4.1 → 0.4.2

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 (3) hide show
  1. package/README.md +2 -2
  2. package/index.js +1 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -47,7 +47,7 @@ object with those keys:
47
47
 
48
48
  If there's no match, `undefined` will be returned.
49
49
 
50
- If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.
50
+ If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
51
51
 
52
52
  ### var r = balanced.range(a, b, str)
53
53
 
@@ -56,7 +56,7 @@ array with indexes: `[ <a index>, <b index> ]`.
56
56
 
57
57
  If there's no match, `undefined` will be returned.
58
58
 
59
- If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`.
59
+ If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
60
60
 
61
61
  ## Installation
62
62
 
package/index.js CHANGED
@@ -30,7 +30,7 @@ function range(a, b, str) {
30
30
  begs = [];
31
31
  left = str.length;
32
32
 
33
- while (i < str.length && i >= 0 && ! result) {
33
+ while (i >= 0 && !result) {
34
34
  if (i == ai) {
35
35
  begs.push(i);
36
36
  ai = str.indexOf(a, i + 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "balanced-match",
3
3
  "description": "Match balanced character pairs, like \"{\" and \"}\"",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git://github.com/juliangruber/balanced-match.git"
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {},
15
15
  "devDependencies": {
16
- "tape": "~4.5.0"
16
+ "tape": "^4.6.0"
17
17
  },
18
18
  "keywords": [
19
19
  "match",