保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 9bdb95c9e34cef640534e5e5a1e2225a80442000
PAMapp/node_modules/yargs/build/lib/parse-command.js
@@ -1,4 +1,7 @@
export function parseCommand(cmd) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseCommand = void 0;
function parseCommand(cmd) {
    const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' ');
    const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
    const bregex = /\.*[\][<>]/g;
@@ -8,7 +11,7 @@
    const parsedCommand = {
        cmd: firstCommand.replace(bregex, ''),
        demanded: [],
        optional: [],
        optional: []
    };
    splitCommand.forEach((cmd, i) => {
        let variadic = false;
@@ -18,15 +21,16 @@
        if (/^\[/.test(cmd)) {
            parsedCommand.optional.push({
                cmd: cmd.replace(bregex, '').split('|'),
                variadic,
                variadic
            });
        }
        else {
            parsedCommand.demanded.push({
                cmd: cmd.replace(bregex, '').split('|'),
                variadic,
                variadic
            });
        }
    });
    return parsedCommand;
}
exports.parseCommand = parseCommand;