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

zapier-async-storage

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zapier-async-storage - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

build/utils/destroyDatabase.js

20

build/createInstance.js

@@ -23,2 +23,6 @@ 'use strict';

var _destroyDatabase = require('./utils/destroyDatabase');
var _destroyDatabase2 = _interopRequireDefault(_destroyDatabase);
var _constants = require('./constants');

@@ -278,2 +282,6 @@

if (options.enableLogging) {
console.info('Closed connection to: ', dbName);
}
resolve();

@@ -284,2 +292,11 @@ });

// Destroys the database instance
function destroy() {
return databaseReadyPromise.then(function (dbInstance) {
dbInstance.close();
return (0, _destroyDatabase2.default)(dbName, options);
});
}
return {

@@ -295,3 +312,4 @@ isReady: databaseReadyPromise,

iterate: _lodash2.default.partial(iterate, storeName),
close: close
close: close,
destroy: destroy
};

@@ -298,0 +316,0 @@ }

@@ -217,2 +217,43 @@ 'use strict';

var destroyDatabase = function destroyDatabase(databaseName) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return new Promise(function (resolve, reject) {
var _opts$enableLogging = opts.enableLogging,
enableLogging = _opts$enableLogging === undefined ? false : _opts$enableLogging;
try {
var req = getIndexedDB().deleteDatabase(databaseName);
req.onsuccess = function () {
if (enableLogging) {
console.info('Successfully removed IndexedDB: ', databaseName);
}
resolve(true);
};
req.onerror = function (err) {
if (enableLogging) {
console.warn('Unable to delete IndexedDB: ', databaseName);
}
reject(err);
};
req.onblocked = function (err) {
if (enableLogging) {
console.warn('Blocked attempting to delete IndexedDB: ', databaseName);
}
reject(err);
};
} catch (err) {
if (enableLogging) {
console.warn('Unable to initialize IndexedDB deletion: ', databaseName);
}
reject(err);
}
});
};
var indexedDB = getIndexedDB();

@@ -468,2 +509,6 @@

if (options.enableLogging) {
console.info('Closed connection to: ', dbName);
}
resolve();

@@ -474,2 +519,11 @@ });

// Destroys the database instance
function destroy() {
return databaseReadyPromise.then(function (dbInstance) {
dbInstance.close();
return destroyDatabase(dbName, options);
});
}
return {

@@ -485,3 +539,4 @@ isReady: databaseReadyPromise,

iterate: _.partial(iterate, storeName),
close: close
close: close,
destroy: destroy
};

@@ -491,2 +546,3 @@ }

exports.createStorageInstance = createInstance;
exports.destroyDatabase = destroyDatabase;
exports.getIndexedDB = getIndexedDB;

2

package.json
{
"name": "zapier-async-storage",
"version": "0.3.1",
"version": "0.3.2",
"description": "Minimalist wrapper for IndexedDB",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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