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

syntex-filesystem

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syntex-filesystem - npm Package Compare versions

Comparing version 1.0.2-b10 to 1.0.2-b11

71

main.js

@@ -9,2 +9,5 @@ const fs = require('fs'), path = require('path');

{
this.running = [];
this.query = {};
this.logger = platform.logger;

@@ -137,23 +140,36 @@

{
if(path.parse(filePath).ext == '.json')
if(!this.running.includes(filePath))
{
data = JSON.stringify(data, null, '\t');
}
this.running.push(filePath);
fs.writeFile(filePath, data, (error) => {
if(!error)
if(path.parse(filePath).ext == '.json')
{
if(this.enableCache)
data = JSON.stringify(data, null, '\t');
}
fs.writeFile(filePath, data, (error) => {
if(!error)
{
cache[filePath] = JSON.stringify(JSON.parse(data));
if(this.enableCache)
{
cache[filePath] = JSON.stringify(JSON.parse(data));
}
}
}
else
{
this.logger.log('error', 'bridge', 'Bridge', '[' + path.parse(filePath).base + '] %update_error%!', error);
}
else
{
this.logger.log('error', 'bridge', 'Bridge', '[' + path.parse(filePath).base + '] %update_error%!', error);
}
resolve({ success : error == null, changed : true });
});
this.running.splice(this.running.indexOf(filePath), 1);
resolve({ success : error == null, changed : true });
delete this.query[this._runQuery(filePath)];
});
}
else
{
this._addQuery({ filePath, data, resolve });
}
}

@@ -255,2 +271,27 @@ else

}
_addQuery(query)
{
var id = 0, keys = Object.keys(this.query);
if(keys.length > 0)
{
id = parseInt(keys[keys.length - 1]) + 1;
}
this.query[id] = query;
}
_runQuery(filePath)
{
for(const id in this.query)
{
if(this.query[id].filePath == filePath)
{
this.writeFile(this.query[id].filePath, this.query[id].data).then((response) => this.query[id].resolve(response));
return id;
}
}
}
}
{
"name": "syntex-filesystem",
"version": "1.0.2-b10",
"version": "1.0.2-b11",
"description": "A Basic File System",

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