Socket
Socket
Sign inDemoInstall

dependents-editor-backend

Package Overview
Dependencies
44
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.3.0

.deprc

2

bin/cli.js

@@ -25,3 +25,3 @@ #!/usr/bin/env node

.option('--get-tree', 'get the dependency tree of the current file')
.option('--get-path', 'get the trimmed path of the current file')
.option('--get-path', 'get the import form of the current filename')

@@ -28,0 +28,0 @@ // Modifiers

var Config = require('./Config');
var getPath = require('./getPath');

@@ -14,3 +15,3 @@ var cabinet = require('filing-cabinet');

debug('given values', program);
debug('given program options', program);

@@ -24,3 +25,5 @@ var config;

} catch (e) {
debug('error when searching for deprc file: ' + e.message);
deferred.reject(e.message);
return deferred.promise;
}

@@ -69,2 +72,9 @@

});
} else if (program.getPath) {
deferred.resolve(getPath({
filename: options.filename,
directory: options.directory,
stylesDirectory: config.stylesRoot
}));
}

@@ -71,0 +81,0 @@

@@ -22,2 +22,4 @@ var fs = require('fs');

Config.prototype.find = function(directory) {
debug('searching for deprc in ' + directory);
if (!directory || directory === '/') {

@@ -52,22 +54,15 @@ throw new Error('.deprc file could not be found');

this.stylesRoot = config.styles_root || config.sass_root;
this.buildConfig = config.build_config;
this.webpackConfig = config.webpack_config;
this.requireConfig = config.config || config.require_config;
this.directory = config.root || this.stylesRoot;
this.stylesRoot = getAbsolute(config.styles_root || config.sass_root, configPath);
this.buildConfig = getAbsolute(config.build_config, configPath);
this.webpackConfig = getAbsolute(config.webpack_config, configPath);
this.requireConfig = getAbsolute(config.config || config.require_config, configPath);
this.directory = getAbsolute(config.root || this.stylesRoot, configPath);
if (this.requireConfig) {
this.requireConfig = path.resolve(path.dirname(configPath), this.requireConfig);
}
if (this.webpackConfig) {
this.webpackConfig = path.resolve(path.dirname(configPath), this.webpackConfig);
}
// CSS users shouldn't need to supply a JS root
this.directory = path.resolve(path.dirname(configPath), this.directory);
this.exclude = config.exclude ? config.exclude.split(',') : [];
};
function getAbsolute(filepath, base) {
return filepath ? path.resolve(path.dirname(base), filepath) : '';
}
/**

@@ -74,0 +69,0 @@ * @private

{
"name": "dependents-editor-backend",
"version": "1.2.0",
"version": "1.3.0",
"description": "The brains behind Dependents editor plugins",

@@ -5,0 +5,0 @@ "main": "lib/cli.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc