aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js')
-rw-r--r--node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js b/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js
new file mode 100644
index 0000000..9a62362
--- /dev/null
+++ b/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js
@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ExpandNpmShortcut = void 0;
+/**
+ * Expands commands prefixed with `npm:`, `yarn:`, `pnpm:`, or `bun:` into the full version `npm run <command>` and so on.
+ */
+class ExpandNpmShortcut {
+ parse(commandInfo) {
+ const [, npmCmd, cmdName, args] = commandInfo.command.match(/^(npm|yarn|pnpm|bun):(\S+)(.*)/) || [];
+ if (!cmdName) {
+ return commandInfo;
+ }
+ return {
+ ...commandInfo,
+ name: commandInfo.name || cmdName,
+ command: `${npmCmd} run ${cmdName}${args}`,
+ };
+ }
+}
+exports.ExpandNpmShortcut = ExpandNpmShortcut;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage