@firebase/app
Advanced tools
Comparing version 0.1.10-canary.3259004 to 0.1.10-canary.4907285
@@ -31,7 +31,9 @@ "use strict"; | ||
var FirebaseAppImpl = /** @class */ (function () { | ||
function FirebaseAppImpl(options, name, firebase_) { | ||
function FirebaseAppImpl(options, config, firebase_) { | ||
this.firebase_ = firebase_; | ||
this.isDeleted_ = false; | ||
this.services_ = {}; | ||
this.name_ = name; | ||
this.name_ = config.name; | ||
this._automaticDataCollectionEnabled = | ||
config.automaticDataCollectionEnabled || false; | ||
this.options_ = util_1.deepCopy(options); | ||
@@ -51,2 +53,14 @@ this.INTERNAL = { | ||
} | ||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", { | ||
get: function () { | ||
this.checkDestroyed_(); | ||
return this._automaticDataCollectionEnabled; | ||
}, | ||
set: function (val) { | ||
this.checkDestroyed_(); | ||
this._automaticDataCollectionEnabled = val; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(FirebaseAppImpl.prototype, "name", { | ||
@@ -184,3 +198,3 @@ get: function () { | ||
Promise: Promise, | ||
SDK_VERSION: '4.12.0-canary.3259004', | ||
SDK_VERSION: '4.12.1-canary.4907285', | ||
INTERNAL: { | ||
@@ -234,18 +248,20 @@ registerService: registerService, | ||
util_1.patchProperty(app, 'App', FirebaseAppImpl); | ||
/** | ||
* Create a new App instance (name must be unique). | ||
*/ | ||
function initializeApp(options, name) { | ||
if (name === undefined) { | ||
name = DEFAULT_ENTRY_NAME; | ||
function initializeApp(options, rawConfig) { | ||
if (rawConfig === void 0) { rawConfig = {}; } | ||
if (typeof rawConfig !== 'object' || rawConfig === null) { | ||
var name_1 = rawConfig; | ||
rawConfig = { name: name_1 }; | ||
} | ||
else { | ||
if (typeof name !== 'string' || name === '') { | ||
error('bad-app-name', { name: name + '' }); | ||
} | ||
var config = rawConfig; | ||
if (config.name === undefined) { | ||
config.name = DEFAULT_ENTRY_NAME; | ||
} | ||
var name = config.name; | ||
if (typeof name !== 'string' || !name) { | ||
error('bad-app-name', { name: name + '' }); | ||
} | ||
if (contains(apps_, name)) { | ||
error('duplicate-app', { name: name }); | ||
} | ||
var app = new FirebaseAppImpl(options, name, namespace); | ||
var app = new FirebaseAppImpl(options, config, namespace); | ||
apps_[name] = app; | ||
@@ -252,0 +268,0 @@ callAppHooks(app, 'create'); |
@@ -29,7 +29,9 @@ /** | ||
var FirebaseAppImpl = /** @class */ (function () { | ||
function FirebaseAppImpl(options, name, firebase_) { | ||
function FirebaseAppImpl(options, config, firebase_) { | ||
this.firebase_ = firebase_; | ||
this.isDeleted_ = false; | ||
this.services_ = {}; | ||
this.name_ = name; | ||
this.name_ = config.name; | ||
this._automaticDataCollectionEnabled = | ||
config.automaticDataCollectionEnabled || false; | ||
this.options_ = deepCopy(options); | ||
@@ -49,2 +51,14 @@ this.INTERNAL = { | ||
} | ||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", { | ||
get: function () { | ||
this.checkDestroyed_(); | ||
return this._automaticDataCollectionEnabled; | ||
}, | ||
set: function (val) { | ||
this.checkDestroyed_(); | ||
this._automaticDataCollectionEnabled = val; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(FirebaseAppImpl.prototype, "name", { | ||
@@ -182,3 +196,3 @@ get: function () { | ||
Promise: Promise, | ||
SDK_VERSION: '4.12.0-canary.3259004', | ||
SDK_VERSION: '4.12.1-canary.4907285', | ||
INTERNAL: { | ||
@@ -232,18 +246,20 @@ registerService: registerService, | ||
patchProperty(app, 'App', FirebaseAppImpl); | ||
/** | ||
* Create a new App instance (name must be unique). | ||
*/ | ||
function initializeApp(options, name) { | ||
if (name === undefined) { | ||
name = DEFAULT_ENTRY_NAME; | ||
function initializeApp(options, rawConfig) { | ||
if (rawConfig === void 0) { rawConfig = {}; } | ||
if (typeof rawConfig !== 'object' || rawConfig === null) { | ||
var name_1 = rawConfig; | ||
rawConfig = { name: name_1 }; | ||
} | ||
else { | ||
if (typeof name !== 'string' || name === '') { | ||
error('bad-app-name', { name: name + '' }); | ||
} | ||
var config = rawConfig; | ||
if (config.name === undefined) { | ||
config.name = DEFAULT_ENTRY_NAME; | ||
} | ||
var name = config.name; | ||
if (typeof name !== 'string' || !name) { | ||
error('bad-app-name', { name: name + '' }); | ||
} | ||
if (contains(apps_, name)) { | ||
error('duplicate-app', { name: name }); | ||
} | ||
var app = new FirebaseAppImpl(options, name, namespace); | ||
var app = new FirebaseAppImpl(options, config, namespace); | ||
apps_[name] = app; | ||
@@ -250,0 +266,0 @@ callAppHooks(app, 'create'); |
{ | ||
"name": "@firebase/app", | ||
"version": "0.1.10-canary.3259004", | ||
"version": "0.1.10-canary.4907285", | ||
"description": "The primary entrypoint to the Firebase JS SDK", | ||
@@ -18,4 +18,4 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", | ||
"dependencies": { | ||
"@firebase/app-types": "0.1.2-canary.3259004", | ||
"@firebase/util": "0.1.10-canary.3259004", | ||
"@firebase/app-types": "0.1.2-canary.4907285", | ||
"@firebase/util": "0.1.10-canary.4907285", | ||
"tslib": "^1.9.0" | ||
@@ -22,0 +22,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84378
875
+ Added@firebase/app-types@0.1.2-canary.4907285(transitive)
+ Added@firebase/util@0.1.10-canary.4907285(transitive)
- Removed@firebase/app-types@0.1.2-canary.3259004(transitive)
- Removed@firebase/util@0.1.10-canary.3259004(transitive)