@firebase/installations
Advanced tools
Comparing version 0.1.7-canary.3caea2b to 0.1.7-canary.43f0036
@@ -12,3 +12,3 @@ 'use strict'; | ||
var version = "0.1.7-canary.3caea2b"; | ||
var version = "0.1.7-canary.43f0036"; | ||
@@ -347,13 +347,19 @@ /** | ||
var OBJECT_STORE_NAME = 'firebase-installations-store'; | ||
var dbPromise = idb.openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDB) { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
var dbPromise = null; | ||
function getDbPromise() { | ||
if (!dbPromise) { | ||
dbPromise = idb.openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDB) { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
} | ||
}); | ||
} | ||
}); | ||
return dbPromise; | ||
} | ||
/** Assigns or overwrites the record for the given key with the given value. */ | ||
@@ -367,3 +373,3 @@ function set(appConfig, value) { | ||
key = getKey(appConfig); | ||
return [4 /*yield*/, dbPromise]; | ||
return [4 /*yield*/, getDbPromise()]; | ||
case 1: | ||
@@ -391,3 +397,3 @@ db = _a.sent(); | ||
key = getKey(appConfig); | ||
return [4 /*yield*/, dbPromise]; | ||
return [4 /*yield*/, getDbPromise()]; | ||
case 1: | ||
@@ -420,3 +426,3 @@ db = _a.sent(); | ||
key = getKey(appConfig); | ||
return [4 /*yield*/, dbPromise]; | ||
return [4 /*yield*/, getDbPromise()]; | ||
case 1: | ||
@@ -423,0 +429,0 @@ db = _a.sent(); |
@@ -7,3 +7,3 @@ import firebase from '@firebase/app'; | ||
var version = "0.1.7-canary.3caea2b"; | ||
var version = "0.1.7-canary.43f0036"; | ||
@@ -342,13 +342,19 @@ /** | ||
var OBJECT_STORE_NAME = 'firebase-installations-store'; | ||
var dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDB) { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
var dbPromise = null; | ||
function getDbPromise() { | ||
if (!dbPromise) { | ||
dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, function (upgradeDB) { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
} | ||
}); | ||
} | ||
}); | ||
return dbPromise; | ||
} | ||
/** Assigns or overwrites the record for the given key with the given value. */ | ||
@@ -362,3 +368,3 @@ function set(appConfig, value) { | ||
key = getKey(appConfig); | ||
return [4 /*yield*/, dbPromise]; | ||
return [4 /*yield*/, getDbPromise()]; | ||
case 1: | ||
@@ -386,3 +392,3 @@ db = _a.sent(); | ||
key = getKey(appConfig); | ||
return [4 /*yield*/, dbPromise]; | ||
return [4 /*yield*/, getDbPromise()]; | ||
case 1: | ||
@@ -415,3 +421,3 @@ db = _a.sent(); | ||
key = getKey(appConfig); | ||
return [4 /*yield*/, dbPromise]; | ||
return [4 /*yield*/, getDbPromise()]; | ||
case 1: | ||
@@ -418,0 +424,0 @@ db = _a.sent(); |
@@ -5,3 +5,3 @@ import firebase from '@firebase/app'; | ||
const version = "0.1.7-canary.3caea2b"; | ||
const version = "0.1.7-canary.43f0036"; | ||
@@ -307,17 +307,23 @@ /** | ||
const OBJECT_STORE_NAME = 'firebase-installations-store'; | ||
const dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, upgradeDB => { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
let dbPromise = null; | ||
function getDbPromise() { | ||
if (!dbPromise) { | ||
dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, upgradeDB => { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
} | ||
}); | ||
} | ||
}); | ||
return dbPromise; | ||
} | ||
/** Assigns or overwrites the record for the given key with the given value. */ | ||
async function set(appConfig, value) { | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -331,3 +337,3 @@ await tx.objectStore(OBJECT_STORE_NAME).put(value, key); | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -345,3 +351,3 @@ await tx.objectStore(OBJECT_STORE_NAME).delete(key); | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -348,0 +354,0 @@ const store = tx.objectStore(OBJECT_STORE_NAME); |
{ | ||
"name": "@firebase/installations", | ||
"version": "0.1.7-canary.3caea2b", | ||
"version": "0.1.7-canary.43f0036", | ||
"main": "dist/index.cjs.js", | ||
@@ -50,8 +50,8 @@ "module": "dist/index.esm.js", | ||
"peerDependencies": { | ||
"@firebase/app": "0.4.6-canary.3caea2b", | ||
"@firebase/app-types": "0.4.0-canary.3caea2b" | ||
"@firebase/app": "0.4.8-canary.43f0036", | ||
"@firebase/app-types": "0.4.0-canary.43f0036" | ||
}, | ||
"dependencies": { | ||
"@firebase/installations-types": "0.1.1-canary.3caea2b", | ||
"@firebase/util": "0.2.20-canary.3caea2b", | ||
"@firebase/installations-types": "0.1.1-canary.43f0036", | ||
"@firebase/util": "0.2.20-canary.43f0036", | ||
"idb": "3.0.2", | ||
@@ -58,0 +58,0 @@ "tslib": "1.9.3" |
@@ -25,17 +25,19 @@ /** | ||
const dbPromise: Promise<DB> = openDb( | ||
DATABASE_NAME, | ||
DATABASE_VERSION, | ||
upgradeDB => { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
} | ||
let dbPromise: Promise<DB> | null = null; | ||
function getDbPromise(): Promise<DB> { | ||
if (!dbPromise) { | ||
dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, upgradeDB => { | ||
// We don't use 'break' in this switch statement, the fall-through | ||
// behavior is what we want, because if there are multiple versions between | ||
// the old version and the current version, we want ALL the migrations | ||
// that correspond to those versions to run, not only the last one. | ||
// eslint-disable-next-line default-case | ||
switch (upgradeDB.oldVersion) { | ||
case 0: | ||
upgradeDB.createObjectStore(OBJECT_STORE_NAME); | ||
} | ||
}); | ||
} | ||
); | ||
return dbPromise; | ||
} | ||
@@ -45,3 +47,3 @@ /** Gets record(s) from the objectStore that match the given key. */ | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
return db | ||
@@ -59,3 +61,3 @@ .transaction(OBJECT_STORE_NAME) | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -70,3 +72,3 @@ await tx.objectStore(OBJECT_STORE_NAME).put(value, key); | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -88,3 +90,3 @@ await tx.objectStore(OBJECT_STORE_NAME).delete(key); | ||
const key = getKey(appConfig); | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -110,3 +112,3 @@ const store = tx.objectStore(OBJECT_STORE_NAME); | ||
export async function clear(): Promise<void> { | ||
const db = await dbPromise; | ||
const db = await getDbPromise(); | ||
const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); | ||
@@ -113,0 +115,0 @@ await tx.objectStore(OBJECT_STORE_NAME).clear(); |
{ | ||
"extends": "../../config/tsconfig.base.json", | ||
"compilerOptions": { | ||
"lib": ["es2017", "dom"], | ||
"downlevelIteration": true, | ||
@@ -6,0 +5,0 @@ "resolveJsonModule": true, |
Sorry, the diff of this file is not supported yet
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 35 instances 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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 35 instances in 1 package
671382
7489
1
+ Added@firebase/app@0.4.8-canary.43f0036(transitive)
+ Added@firebase/app-types@0.4.0-canary.43f0036(transitive)
+ Added@firebase/installations-types@0.1.1-canary.43f0036(transitive)
+ Added@firebase/logger@0.1.17-canary.43f0036(transitive)
+ Added@firebase/util@0.2.20-canary.43f0036(transitive)
- Removed@firebase/app@0.4.6-canary.3caea2b(transitive)
- Removed@firebase/app-types@0.4.0-canary.3caea2b(transitive)
- Removed@firebase/installations-types@0.1.1-canary.3caea2b(transitive)
- Removed@firebase/logger@0.1.17-canary.3caea2b(transitive)
- Removed@firebase/util@0.2.20-canary.3caea2b(transitive)