Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/installations

Package Overview
Dependencies
Maintainers
5
Versions
2730
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/installations - npm Package Compare versions

Comparing version 0.1.7-canary.3caea2b to 0.1.7-canary.43f0036

.rpt2_cache/rpt2_918cd379c126b692cff4c0d4055971d4ce2b6621/code/cache/011f65162f121c1aafb5173275d479529cef0a2e

34

dist/index.cjs.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc