Skip to content

Commit f09bf69

Browse files
committed
Fixed soumak77#110 - Remove leading slashes in updates before using key
1 parent 9a9935d commit f09bf69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/firebase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ MockFirebase.prototype.update = function (changes, callback) {
194194
// operate as a multi-set
195195
_.keys(changes).forEach(function (key) {
196196
var val = changes[key];
197-
_.set(data, key.replace(/\//g, '.'), _.isObject(val) ? utils.updateToRtdbObject(val) : val);
197+
_.set(data, key.replace(/^\//, '').replace(/\//g, '.'), _.isObject(val) ? utils.updateToRtdbObject(val) : val);
198198
});
199199
data = utils.removeEmptyRtdbProperties(data);
200200
self._dataChanged(data);

0 commit comments

Comments
 (0)