From 0cd2048b2c655295c0ecd6f8e22b71eb2dcf3ba1 Mon Sep 17 00:00:00 2001 From: Jacob Wenger Date: Wed, 25 May 2016 13:44:06 -0700 Subject: [PATCH 1/4] Fixed getKey() helper to handle snapshots at the root ref --- src/geoFireUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geoFireUtils.js b/src/geoFireUtils.js index 5013e155..a18b85ff 100644 --- a/src/geoFireUtils.js +++ b/src/geoFireUtils.js @@ -459,7 +459,7 @@ function decodeGeoFireObject(geoFireObj) { var key; if (typeof snapshot.key === "function") { key = snapshot.key(); - } else if (typeof snapshot.key === "string") { + } else if (typeof snapshot.key === "string" || snapshot.key === null) { key = snapshot.key; } else { key = snapshot.name(); From dfd6aa2f69192261a3c568ad9a8cb5e02d122bcc Mon Sep 17 00:00:00 2001 From: Jacob Wenger Date: Wed, 25 May 2016 13:48:22 -0700 Subject: [PATCH 2/4] Cleaned up comments for getKey() helper --- src/geoFireUtils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/geoFireUtils.js b/src/geoFireUtils.js index a18b85ff..8761c4b4 100644 --- a/src/geoFireUtils.js +++ b/src/geoFireUtils.js @@ -450,10 +450,10 @@ function decodeGeoFireObject(geoFireObj) { } /** - * Get the key of a Firebase snapshot across SDK versions + * Returns the key of a Firebase snapshot across SDK versions. * - * @param {Object} snapshot A Firebase Snapshot - * @return {String} key The Firebase snapshot's key + * @param {DataSnapshot} snapshot A Firebase snapshot + * @return {String|null} key The Firebase snapshot's key. */ function getKey(snapshot) { var key; From 9e1a95641cff12b9c05f766a1f57d986e688c652 Mon Sep 17 00:00:00 2001 From: Jacob Wenger Date: Wed, 25 May 2016 13:48:36 -0700 Subject: [PATCH 3/4] Added missing period --- src/geoFireUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geoFireUtils.js b/src/geoFireUtils.js index 8761c4b4..8b7f8a34 100644 --- a/src/geoFireUtils.js +++ b/src/geoFireUtils.js @@ -452,7 +452,7 @@ function decodeGeoFireObject(geoFireObj) { /** * Returns the key of a Firebase snapshot across SDK versions. * - * @param {DataSnapshot} snapshot A Firebase snapshot + * @param {DataSnapshot} snapshot A Firebase snapshot. * @return {String|null} key The Firebase snapshot's key. */ function getKey(snapshot) { From 66292a95a5210b46d72fbc5b588f8c35cfcad665 Mon Sep 17 00:00:00 2001 From: Jacob Wenger Date: Wed, 25 May 2016 13:48:51 -0700 Subject: [PATCH 4/4] Fixed JSDoc comment --- src/geoFireUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geoFireUtils.js b/src/geoFireUtils.js index 8b7f8a34..30651839 100644 --- a/src/geoFireUtils.js +++ b/src/geoFireUtils.js @@ -453,7 +453,7 @@ function decodeGeoFireObject(geoFireObj) { * Returns the key of a Firebase snapshot across SDK versions. * * @param {DataSnapshot} snapshot A Firebase snapshot. - * @return {String|null} key The Firebase snapshot's key. + * @return {string|null} key The Firebase snapshot's key. */ function getKey(snapshot) { var key;