statebus 7.0.19 → 7.0.21

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/client-library.js CHANGED
@@ -88,10 +88,10 @@
88
88
  function send_put (id) {
89
89
  var the_put = puts.get(id)
90
90
  try {
91
- console.log('Sending a put!', {
92
- patches: the_put.patches,
93
- body: the_put.body
94
- })
91
+ // console.log('Sending a put!', {
92
+ // patches: the_put.patches,
93
+ // body: the_put.body
94
+ // })
95
95
 
96
96
  the_put.status = 'sending'
97
97
  braid_fetch(
@@ -108,7 +108,7 @@
108
108
  }
109
109
  ).then(function (res) {
110
110
  if (res.status === 200) {
111
- console.log('PUT succeeded!')
111
+ // console.log('PUT succeeded!')
112
112
  puts.delete(id)
113
113
  }
114
114
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "statebus",
3
- "version": "7.0.19",
3
+ "version": "7.0.21",
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,