diff --git a/lib/modules/database/reference.js b/lib/modules/database/reference.js index b848cfda..4951b035 100644 --- a/lib/modules/database/reference.js +++ b/lib/modules/database/reference.js @@ -337,6 +337,17 @@ export default class Reference extends ReferenceBase { return this.path; } + /** + * Returns whether another Reference represent the same location and are from the + * same instance of firebase.app.App - multiple firebase apps not currently supported. + * @param {Reference} otherRef - Other reference to compare to this one + * @return {Boolean} Whether otherReference is equal to this one + * {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#isEqual} + */ + isEqual(otherRef: Reference): boolean { + return !!otherRef && otherRef.constructor === Reference && otherRef.key === this.key; + } + /** * GETTERS */