UNPKG

react-native-firebase-compiled

Version:

A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto

34 lines (26 loc) 943 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } class ReferenceBase { constructor(path) { _defineProperty(this, "path", void 0); if (path) { this.path = path.length > 1 && path.endsWith('/') ? path.substring(0, path.length - 1) : path; } else { this.path = '/'; } } /** * The last part of a Reference's path (after the last '/') * The key of a root Reference is null. * @type {String} * {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#key} */ get key() { return this.path === '/' ? null : this.path.substring(this.path.lastIndexOf('/') + 1); } } exports.default = ReferenceBase;