Actualizacion de seguridad
This commit is contained in:
43
node_modules/nodemon/lib/config/exec.js
generated
vendored
43
node_modules/nodemon/lib/config/exec.js
generated
vendored
@@ -27,7 +27,7 @@ function execFromPackage() {
|
||||
if (pkg.scripts && pkg.scripts.start) {
|
||||
return { exec: pkg.scripts.start };
|
||||
}
|
||||
} catch (e) { }
|
||||
} catch (e) {}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -78,8 +78,10 @@ function exec(nodemonOptions, execMap) {
|
||||
|
||||
// if there's no script passed, try to get it from the first argument
|
||||
if (!options.script && (options.args || []).length) {
|
||||
script = expandScript(options.args[0],
|
||||
options.ext && ('.' + (options.ext || 'js').split(',')[0]));
|
||||
script = expandScript(
|
||||
options.args[0],
|
||||
options.ext && '.' + (options.ext || 'js').split(',')[0]
|
||||
);
|
||||
|
||||
// if the script was found, shift it off our args
|
||||
if (script !== options.args[0]) {
|
||||
@@ -101,8 +103,7 @@ function exec(nodemonOptions, execMap) {
|
||||
if (!options.script) {
|
||||
options.script = found.script;
|
||||
}
|
||||
if (Array.isArray(options.args) &&
|
||||
options.scriptPosition === null) {
|
||||
if (Array.isArray(options.args) && options.scriptPosition === null) {
|
||||
options.scriptPosition = options.args.length;
|
||||
}
|
||||
}
|
||||
@@ -115,8 +116,8 @@ function exec(nodemonOptions, execMap) {
|
||||
|
||||
var extension = options.ext;
|
||||
if (extension === undefined) {
|
||||
var isJS = scriptExt === 'js' || scriptExt === 'mjs';
|
||||
extension = (isJS || !scriptExt) ? 'js,mjs' : scriptExt;
|
||||
var isJS = scriptExt === 'js' || scriptExt === 'mjs' || scriptExt === 'cjs';
|
||||
extension = isJS || !scriptExt ? 'js,mjs,cjs' : scriptExt;
|
||||
extension += ',json'; // Always watch JSON files
|
||||
}
|
||||
|
||||
@@ -147,8 +148,10 @@ function exec(nodemonOptions, execMap) {
|
||||
});
|
||||
|
||||
var newExec = substitution(options.exec);
|
||||
if (newExec !== options.exec &&
|
||||
options.exec.indexOf('{{filename}}') !== -1) {
|
||||
if (
|
||||
newExec !== options.exec &&
|
||||
options.exec.indexOf('{{filename}}') !== -1
|
||||
) {
|
||||
options.script = null;
|
||||
}
|
||||
options.exec = newExec;
|
||||
@@ -160,14 +163,16 @@ function exec(nodemonOptions, execMap) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) {
|
||||
options.execArgs = options.execArgs.concat(options.nodeArgs);
|
||||
}
|
||||
|
||||
// note: indexOf('coffee') handles both .coffee and .litcoffee
|
||||
if (!execDefined && options.exec === 'node' &&
|
||||
scriptExt.indexOf('coffee') !== -1) {
|
||||
if (
|
||||
!execDefined &&
|
||||
options.exec === 'node' &&
|
||||
scriptExt.indexOf('coffee') !== -1
|
||||
) {
|
||||
options.exec = 'coffee';
|
||||
|
||||
// we need to get execArgs set before the script
|
||||
@@ -187,7 +192,9 @@ function exec(nodemonOptions, execMap) {
|
||||
if (options.exec === 'coffee') {
|
||||
// don't override user specified extension tracking
|
||||
if (options.ext === undefined) {
|
||||
if (extension) { extension += ','; }
|
||||
if (extension) {
|
||||
extension += ',';
|
||||
}
|
||||
extension += 'coffee,litcoffee';
|
||||
}
|
||||
|
||||
@@ -203,19 +210,21 @@ function exec(nodemonOptions, execMap) {
|
||||
// because the terminal will automatically expand the glob against
|
||||
// the file system :(
|
||||
extension = (extension.match(/[^,*\s]+/g) || [])
|
||||
.map(ext => ext.replace(/^\./, ''))
|
||||
.map((ext) => ext.replace(/^\./, ''))
|
||||
.join(',');
|
||||
|
||||
options.ext = extension;
|
||||
|
||||
if (options.script) {
|
||||
options.script = expandScript(options.script,
|
||||
extension && ('.' + extension.split(',')[0]));
|
||||
options.script = expandScript(
|
||||
options.script,
|
||||
extension && '.' + extension.split(',')[0]
|
||||
);
|
||||
}
|
||||
|
||||
options.env = {};
|
||||
// make sure it's an object (and since we don't have )
|
||||
if (({}).toString.apply(nodemonOptions.env) === '[object Object]') {
|
||||
if ({}.toString.apply(nodemonOptions.env) === '[object Object]') {
|
||||
options.env = utils.clone(nodemonOptions.env);
|
||||
} else if (nodemonOptions.env !== undefined) {
|
||||
throw new Error('nodemon env values must be an object: { PORT: 8000 }');
|
||||
|
||||
Reference in New Issue
Block a user