UNPKG

436 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function checkCommand(commands, depth = 0) {
4 return (argv) => {
5 const executedCommand = argv._[depth];
6 for (const cmd of commands) {
7 if (executedCommand === cmd) {
8 return true;
9 }
10 }
11 throw new Error(`Unknown command: ${executedCommand}`);
12 };
13}
14exports.checkCommand = checkCommand;