statebus 7.0.19 → 7.0.20

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/package.json +1 -1
  2. package/statebus.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "statebus",
3
- "version": "7.0.19",
3
+ "version": "7.0.20",
4
4
  "description": "Synchronize state.",
5
5
  "main": "statebus.js",
6
6
  "scripts": {
package/statebus.js CHANGED
@@ -1784,9 +1784,9 @@
1784
1784
  // The final object can be a slice
1785
1785
  // Set the value in the final object
1786
1786
 
1787
- var x = patch.match(/(.*) = (.*)/),
1788
- path = x[1],
1789
- new_stuff = JSON.parse(x[2])
1787
+ var match = patch.match(/(.*) = (.*)/),
1788
+ path = match[1],
1789
+ new_stuff = match[2].length ? JSON.parse(match[2]) : undefined
1790
1790
 
1791
1791
  var path_segment = /^(\.?([^\.\[]+))|(\[((-?\d+):)?(-?\d+)\])|\[("(\\"|[^"])*")\]/
1792
1792
  var curr_obj = obj,