aoc-automation
Version:
Advent of Code tool to automate the repetitive parts of AoC.
49 lines (48 loc) • 1.16 kB
JavaScript
import prompts from "prompts";
var AsciiOptions = /* @__PURE__ */ ((AsciiOptions2) => {
AsciiOptions2[AsciiOptions2["INTERPRETED"] = 0] = "INTERPRETED";
AsciiOptions2[AsciiOptions2["AS_IS"] = 1] = "AS_IS";
AsciiOptions2[AsciiOptions2["CANCEL"] = 2] = "CANCEL";
return AsciiOptions2;
})(AsciiOptions || {});
const asciiPrompt = (part) => {
return prompts(
[
{
type: "select",
name: "choice",
message: "What do you want to do?",
choices: [
{
title: "Provide interpreted solution",
value: 0 /* INTERPRETED */
},
{
title: "Send as is",
value: 1 /* AS_IS */
},
{
title: "Cancel",
value: 2 /* CANCEL */
}
],
initial: 0
},
{
type: (prev) => prev === 0 /* INTERPRETED */ ? "text" : null,
name: "replacement",
message: `Solution part ${part}`
}
],
{
onCancel: () => {
process.exit();
}
}
);
};
var asciiPrompt_default = asciiPrompt;
export {
AsciiOptions,
asciiPrompt_default as default
};