Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / execa / node_modules / cross-spawn / lib / util / escapeCommand.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/execa/node_modules/cross-spawn/lib/util/escapeCommand.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/execa/node_modules/cross-spawn/lib/util/escapeCommand.js
new file mode 100644 (file)
index 0000000..d9c25b2
--- /dev/null
@@ -0,0 +1,12 @@
+'use strict';
+
+var escapeArgument = require('./escapeArgument');
+
+function escapeCommand(command) {
+    // Do not escape if this command is not dangerous..
+    // We do this so that commands like "echo" or "ifconfig" work
+    // Quoting them, will make them unaccessible
+    return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true);
+}
+
+module.exports = escapeCommand;