Skip to content

Commit 9eb10b9

Browse files
committed
Allow accesing children in data snapshot by numbered array index
1 parent 42b9086 commit 9eb10b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/snapshot.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function MockDataSnapshot (ref, data, priority) {
1515
}
1616

1717
MockDataSnapshot.prototype.child = function (path) {
18+
if (typeof path === 'number') path = String(path);
1819
// Strip leading or trailing /
1920
path = path.replace(/^\/|\/$/g, '');
2021
var ref = this.ref.child(path);

0 commit comments

Comments
 (0)