archieve-projects/微信机器人/node_modules/cmd-ts/dist/cjs/binary.js

24 lines
715 B
JavaScript
Executable File

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.binary = void 0;
/**
* A small helper to easily use `process.argv` without dropping context
*
* @param cmd a command line parser
*/
function binary(cmd) {
return {
...cmd,
run(context) {
var _a;
const name = cmd.name || context.nodes[1].raw;
(_a = context.hotPath) === null || _a === void 0 ? void 0 : _a.push(name);
context.nodes.splice(0, 1);
context.nodes[0].raw = name;
context.visitedNodes.add(context.nodes[0]);
return cmd.run(context);
},
};
}
exports.binary = binary;
//# sourceMappingURL=binary.js.map