Socket
Socket
Sign inDemoInstall

dependents-editor-backend

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependents-editor-backend - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

lib/getClickedImport.js

2

bin/cli.js

@@ -23,2 +23,4 @@ #!/usr/bin/env node

.option('--lookup', 'perform a partial lookup for the jump to dependency feature')
.option('--lookup-position', 'jump to dependency: location of the clicked character of the target')
.option('--find-dependents', 'get the dependents of the current file')

@@ -25,0 +27,0 @@ .option('--find-drivers', 'get the driver scripts relevant to current file')

25

lib/cli.js
var Config = require('./Config');
var getPath = require('./getPath');
var getClickedImport = require('./getClickedImport');

@@ -19,7 +20,6 @@ var cabinet = require('filing-cabinet');

if (program.debug) {
// TODO: Try setting process.env.DEBUG instead
debug = console.log.bind(console);
}
debug('given program options', program);
var config;

@@ -48,13 +48,13 @@ try {

if (program.lookup) {
options.target = program.args[0].replace(/["|'|;]/g, '');
debug('performing a lookup');
if (!program.lookupPosition) {
options.partial = program.args[0].replace(/["|'|;]/g, '');
} else {
debug('given a lookup location: ', program.lookupPosition);
options.partial = getClickedImport(program.args[0], Number(program.lookupPosition));
}
var result = cabinet({
partial: options.target,
filename: options.filename,
directory: options.directory,
config: options.config,
webpackConfig: options.webpackConfig
});
debug('performing a lookup with options: ', options);
var result = cabinet(options);
debug('lookup result: ' + result);

@@ -129,2 +129,5 @@ deferred.resolve(result);

deferred.resolve(config.toJSON());
} else {
deferred.reject('No valid command given');
}

@@ -131,0 +134,0 @@

{
"name": "dependents-editor-backend",
"version": "1.9.0",
"version": "1.10.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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc