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

dexie-encrypted

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dexie-encrypted - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

26

dist/index.js

@@ -94,4 +94,3 @@ 'use strict';

function encrypt(db, key, cryptoSettings, nonceOverride) {
if ((key instanceof Uint8Array) === false || key.length !== 32) {
if (key instanceof Uint8Array === false || key.length !== 32) {
throw new Error('Dexie-encrypted requires a UInt8Array of length 32 for a encryption key.');

@@ -109,3 +108,5 @@ }

} catch (error) {
throw new Error("Dexie-encrypt: The call to encrypt() cannot be done on an open database");
throw new Error(
'Dexie-encrypt: The call to encrypt() cannot be done on an open database'
);
}

@@ -151,3 +152,3 @@ }

}
if (entity.__encryptedData) {
if (entity && entity.__encryptedData) {
const nonce = entity.__encryptedData.slice(0, nacl.secretbox.nonceLength);

@@ -177,5 +178,7 @@ const message = entity.__encryptedData.slice(

try {
encryptionSettings = db.table("_encryptionSettings");
encryptionSettings = db.table('_encryptionSettings');
} catch (error) {
throw new Error("Dexie-encrypted can't find its encryption table. You may need to bump your database version.");
throw new Error(
"Dexie-encrypted can't find its encryption table. You may need to bump your database version."
);
}

@@ -196,3 +199,3 @@ return encryptionSettings

table.hook('creating', function(primKey, obj) {
const preservedValue = {...obj};
const preservedValue = { ...obj };
encryptWithRule(table, obj, newSetting);

@@ -247,5 +250,8 @@ this.onsuccess = () => {

return encryptionSettings.put(cryptoSettings);
}).catch(error => {
if (error.name === "NotFoundError") {
throw new Error("Dexie-encrypted can't find its encryption table. You may need to bump your database version.");
})
.catch(error => {
if (error.name === 'NotFoundError') {
throw new Error(
"Dexie-encrypted can't find its encryption table. You may need to bump your database version."
);
} else {

@@ -252,0 +258,0 @@ return Promise.reject(error);

{
"name": "dexie-encrypted",
"version": "1.0.2",
"version": "1.0.3",
"description": "Encryption middleware for Dexie",

@@ -5,0 +5,0 @@ "main": "dist/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