@firebase/app
Advanced tools
Comparing version 0.1.10-canary.121c167 to 0.1.10-canary.12e839d
@@ -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.10.1-canary.121c167', | ||
SDK_VERSION: '4.12.1-canary.12e839d', | ||
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.10.1-canary.121c167', | ||
SDK_VERSION: '4.12.1-canary.12e839d', | ||
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.121c167", | ||
"version": "0.1.10-canary.12e839d", | ||
"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.121c167", | ||
"@firebase/util": "0.1.10-canary.121c167", | ||
"@firebase/app-types": "0.1.2-canary.12e839d", | ||
"@firebase/util": "0.1.10-canary.12e839d", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84362
875
19
+ Added@firebase/app-types@0.1.2-canary.12e839d(transitive)
+ Added@firebase/util@0.1.10-canary.12e839d(transitive)
- Removed@firebase/app-types@0.1.2-canary.121c167(transitive)
- Removed@firebase/util@0.1.10-canary.121c167(transitive)