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

informa-db.js

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

informa-db.js - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

26

browser.js

@@ -23,2 +23,26 @@ import DbUtils from './utils.js'; // eslint-disable-line import/extensions

genProxy(data) {
return new Proxy(data, {
set: (obj, prop, val) => {
obj[prop] = val;
if (this.saveOnChange) {
this.update();
}
return true;
},
deleteProperty: (obj, prop) => {
delete obj[prop];
if (this.saveOnChange) {
this.update();
}
return true;
},
get: (obj, prop) => (
typeof obj[prop] === 'object' && obj[prop]
? this.genProxy(obj[prop])
: obj[prop]
),
});
}
/**

@@ -50,3 +74,3 @@ * async Updates the file/db from this.readOnlyValue

get value() {
return DbUtils.genProxy(this.readOnlyValue, this.saveOnChange, this.update);
return this.genProxy(this.readOnlyValue);
}

@@ -53,0 +77,0 @@ }

2

package.json
{
"name": "informa-db.js",
"version": "2.3.2",
"version": "2.3.3",
"description": "DataBases made easier",

@@ -5,0 +5,0 @@ "main": "server.js",

@@ -24,2 +24,26 @@ const fs = require('fs');

genProxy(data, saveOnChange, update) {
return new Proxy(data, {
set: (obj, prop, val) => {
obj[prop] = val;
if (saveOnChange) {
update();
}
return true;
},
deleteProperty: (obj, prop) => {
delete obj[prop];
if (saveOnChange) {
update();
}
return true;
},
get: (obj, prop) => (
typeof obj[prop] === 'object' && obj[prop]
? this.genProxy(obj[prop])
: obj[prop]
),
});
}
/**

@@ -51,3 +75,3 @@ * async Updates the file/db from this.readOnlyValue

get value() {
return DbUtils.genProxy(this.readOnlyValue, this.saveOnChange, this.update);
return this.genProxy(this.readOnlyValue);
}

@@ -54,0 +78,0 @@ }

@@ -6,25 +6,2 @@ export default {

},
genProxy(data, saveOnChange, update) {
return new Proxy(data, {
set: (obj, prop, val) => {
obj[prop] = val;
if (saveOnChange) {
update();
}
return true;
},
deleteProperty: (obj, prop) => {
delete obj[prop];
if (saveOnChange) {
update();
}
return true;
},
get: (obj, prop) => (
typeof obj[prop] === 'object' && obj[prop]
? this.genProxy(obj[prop])
: obj[prop]
),
});
},
};
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