UNPKG

onemon

Version:

Run a npm script as a deamon, once

32 lines 832 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCommand = exports.CommandType = void 0; /** * @module */ var CommandType; (function (CommandType) { CommandType["KILL"] = "kill"; CommandType["RUN"] = "run"; })(CommandType = exports.CommandType || (exports.CommandType = {})); ; ; const getCommand = (input) => { const commandType = Object.values(CommandType).find(value => value.toString() === input[0]); if (commandType !== undefined) { return { type: commandType, deamon: input[1], script: input[2] }; } else { return { type: CommandType.RUN, deamon: input[0], script: input[1] }; } }; exports.getCommand = getCommand; //# sourceMappingURL=getCommand.js.map