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

wild-config

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wild-config - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

52

index.js

@@ -51,29 +51,33 @@ /* eslint no-console: 0, global-require: 0 */

if (!stat.isFile()) {
throw new Error('path is not a file');
throw new Error(filePath + ' is not a file');
}
let parsed;
try {
let contents = fs.readFileSync(filePath, 'utf-8');
let contents = fs.readFileSync(filePath, 'utf-8');
switch (ext) {
case '.js': {
let script = new vm.Script(contents);
const sandbox = {
require,
__dirname: basePath,
__filename: filePath,
module: {
exports: {}
}
};
script.runInNewContext(sandbox);
parsed = sandbox.module.exports;
break;
switch (ext) {
case '.js': {
let script = new vm.Script(contents);
const sandbox = {
require,
__dirname: basePath,
__filename: filePath,
module: {
exports: {}
}
};
script.runInNewContext(sandbox);
parsed = sandbox.module.exports;
break;
}
case '.toml':
parsed = tomlParser(basePath, contents);
break;
case '.json':
parsed = JSON.parse(contents);
break;
}
case '.toml':
parsed = tomlParser(basePath, contents);
break;
case '.json':
parsed = JSON.parse(contents);
break;
} catch (E) {
E.message = filePath + ': ' + E.message;
throw E;
}

@@ -132,3 +136,3 @@ return parsed;

// file missing, ignore
console.error(filePath + ': ' + E.message);
console.error('[' + filePath + '] ' + E.message);
process.exit(1);

@@ -135,0 +139,0 @@ }

{
"name": "wild-config",
"version": "1.2.2",
"version": "1.2.3",
"description": "Configuration management module",

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