Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function FirebaseAppLiteImpl(options, config, firebase_) {
this.firebase_ = firebase_;
this.isDeleted_ = false;
this.services_ = {};
// lite version has an empty INTERNAL namespace
this.INTERNAL = {};
this.name_ = config.name;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = deepCopy(options);
}
Object.defineProperty(FirebaseAppLiteImpl.prototype, "automaticDataCollectionEnabled", {
function FirebaseAppImpl(options, config, firebase_) {
var e_1, _a;
var _this = this;
this.firebase_ = firebase_;
this.isDeleted_ = false;
this.name_ = config.name;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = util.deepCopy(options);
this.container = new component.ComponentContainer(config.name);
// add itself to container
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
try {
// populate ComponentContainer with existing components
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
var component$1 = _c.value;
this._addComponent(component$1);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
constructor(options, config, firebase_) {
this.firebase_ = firebase_;
this.isDeleted_ = false;
this.services_ = {};
// An array to capture listeners before the true auth functions
// exist
this.tokenListeners_ = [];
// An array to capture requests to send events before analytics component loads.
// eslint-disable-next-line @typescript-eslint/no-explicit-any, use any here to make using function.apply easier
this.analyticsEventRequests_ = [];
this.name_ = config.name;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = deepCopy(options);
const self = this;
this.INTERNAL = {
getUid: () => null,
getToken: () => Promise.resolve(null),
addAuthTokenListener: (callback) => {
this.tokenListeners_.push(callback);
// Make sure callback is called, asynchronously, in the absence of the auth module
setTimeout(() => callback(null), 0);
},
removeAuthTokenListener: callback => {
this.tokenListeners_ = this.tokenListeners_.filter(listener => listener !== callback);
},
analytics: {
logEvent() {
self.analyticsEventRequests_.push(arguments);
}
function FirebaseAppImpl(options, config, firebase_) {
var e_1, _a;
var _this = this;
this.firebase_ = firebase_;
this.isDeleted_ = false;
this.name_ = config.name;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = util.deepCopy(options);
this.container = new component.ComponentContainer(config.name);
// add itself to container
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
try {
// populate ComponentContainer with existing components
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
var component$1 = _c.value;
this._addComponent(component$1);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
constructor(options, config, firebase_) {
this.firebase_ = firebase_;
this.isDeleted_ = false;
// lite version has an empty INTERNAL namespace
this.INTERNAL = {};
this.name_ = config.name;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = deepCopy(options);
this.container = new ComponentContainer(config.name);
// add itself to container
this.container.addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
// populate ComponentContainer with existing components
for (const component of this.firebase_.INTERNAL.components.values()) {
this.container.addComponent(component);
}
}
get automaticDataCollectionEnabled() {
constructor(options, config, firebase_) {
this.firebase_ = firebase_;
this.isDeleted_ = false;
this.name_ = config.name;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = deepCopy(options);
this.container = new ComponentContainer(config.name);
// add itself to container
this._addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
// populate ComponentContainer with existing components
for (const component of this.firebase_.INTERNAL.components.values()) {
this._addComponent(component);
}
}
get automaticDataCollectionEnabled() {
function FirebaseAppImpl(options, name, firebase_) {
this.firebase_ = firebase_;
this.isDeleted_ = false;
this.services_ = {};
this.name_ = name;
this.options_ = util_1.deepCopy(options);
this.INTERNAL = {
getUid: function () { return null; },
getToken: function () { return Promise.resolve(null); },
addAuthTokenListener: function (callback) {
tokenListeners.push(callback);
// Make sure callback is called, asynchronously, in the absence of the auth module
setTimeout(function () { return callback(null); }, 0);
},
removeAuthTokenListener: function (callback) {
tokenListeners = tokenListeners.filter(function (listener) { return listener !== callback; });
}
};
}
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
constructor(options: FirebaseOptions, config: FirebaseAppConfig) {
this._name = config.name!;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this._options = deepCopy(options);
}
get() {
return deepCopy(this.counters_);
}
}
constructor(
options: FirebaseOptions,
config: FirebaseAppConfig,
private readonly firebase_: _FirebaseNamespace
) {
this.name_ = config.name!;
this.automaticDataCollectionEnabled_ =
config.automaticDataCollectionEnabled || false;
this.options_ = deepCopy(options);
}