Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function app(name) {
name = name || DEFAULT_ENTRY_NAME;
if (!contains(apps, name)) {
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
}
return apps[name];
}
// @ts-ignore
if (rawConfig === void 0) { rawConfig = {}; }
if (typeof rawConfig !== 'object' || rawConfig === null) {
var name_1 = rawConfig;
rawConfig = { name: name_1 };
}
var config = rawConfig;
if (config.name === undefined) {
config.name = DEFAULT_ENTRY_NAME;
}
var name = config.name;
if (typeof name !== 'string' || !name) {
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
appName: String(name)
});
}
if (util.contains(apps, name)) {
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
}
var app = new firebaseAppImpl(options, config, namespace);
apps[name] = app;
return app;
}
/*
function app(name) {
name = name || DEFAULT_ENTRY_NAME;
if (!contains(apps, name)) {
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
}
return apps[name];
}
// @ts-ignore
if (rawConfig === void 0) { rawConfig = {}; }
if (typeof rawConfig !== 'object' || rawConfig === null) {
var name_1 = rawConfig;
rawConfig = { name: name_1 };
}
var config = rawConfig;
if (config.name === undefined) {
config.name = DEFAULT_ENTRY_NAME;
}
var name = config.name;
if (typeof name !== 'string' || !name) {
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
appName: String(name)
});
}
if (contains(apps, name)) {
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
}
var app = new firebaseAppImpl(options, config, namespace);
apps[name] = app;
return app;
}
/*
function initializeApp(options, rawConfig = {}) {
if (typeof rawConfig !== 'object' || rawConfig === null) {
const name = rawConfig;
rawConfig = { name };
}
const config = rawConfig;
if (config.name === undefined) {
config.name = DEFAULT_ENTRY_NAME;
}
const { name } = config;
if (typeof name !== 'string' || !name) {
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
appName: String(name)
});
}
if (contains(apps, name)) {
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
}
const app = new firebaseAppImpl(options, config, namespace);
apps[name] = app;
return app;
}
/*
function initializeApp(options, rawConfig = {}) {
if (typeof rawConfig !== 'object' || rawConfig === null) {
const name = rawConfig;
rawConfig = { name };
}
const config = rawConfig;
if (config.name === undefined) {
config.name = DEFAULT_ENTRY_NAME;
}
const { name } = config;
if (typeof name !== 'string' || !name) {
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
appName: String(name)
});
}
if (contains(apps, name)) {
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
}
const app = new firebaseAppImpl(options, config, namespace);
apps[name] = app;
return app;
}
/*
function app(name) {
name = name || DEFAULT_ENTRY_NAME;
if (!util.contains(apps, name)) {
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
}
return apps[name];
}
// @ts-ignore
function app(name) {
name = name || DEFAULT_ENTRY_NAME;
if (!contains(apps, name)) {
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
}
return apps[name];
}
// @ts-ignore
function app(name) {
name = name || DEFAULT_ENTRY_NAME;
if (!contains(apps, name)) {
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
}
return apps[name];
}
// @ts-ignore
each(stats, (stat: string, value: number) => {
if (value > 0 && contains(this.statsToReport_, stat)) {
reportedStats[stat] = value;
haveStatsToReport = true;
}
});