Express State v1.1.3 — Output Bug Fix
This patch release fixes an issue where an error would be thrown when evaluating the JavaScript output of exposed data with deep namespaces (#23).
The following will no longer throw an error when its output is evaluated in the browser:
app.expose({}, 'foo');
app.expose('baz', 'foo.bar.baz');
Previously, this would output the following and throw because root.foo.bar
was undefined
:
root.foo || (root.foo = {});
root.foo.bar || (root.foo.bar = {});
root.foo = {};
root.foo.bar.baz = "baz";
Now, the namespaces are initialized next to where data will be assigned to them and now outputs the following:
root.foo = {};
root.foo || (root.foo = {});
root.foo.bar || (root.foo.bar = {});
root.foo.bar.baz = "baz";
Thanks to @jeremyruppel for finding the bug and contributing the fix!