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.0.1 to 2.1.0

24

index.js

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

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]
),
});
}
/**

@@ -25,0 +49,0 @@ * async Updates the file/db from this.readOnlyValue

7

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

@@ -9,2 +9,7 @@ "main": "index.js",

"repository": "https://github.com/informathemusic/informa-db.js",
"keywords": [
"file-based database",
"json",
"backend"
],
"publishConfig": {

@@ -11,0 +16,0 @@ "registry": "https://registry.npmjs.org/"

23

utils.js

@@ -6,25 +6,2 @@ module.exports = {

},
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]
),
});
},
};
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