maests
Version:
An executable compiler for creating Maestro's yaml-flows with typescript.
23 lines (22 loc) • 696 B
JavaScript
import { stringify } from "yaml";
import { handleNest, addOut } from "../out.mjs";
import "./commands.mjs";
const repeat = (props, func) => {
const out = handleNest(func, !0), cmd = [{ repeat: { ...props, commands: out } }];
addOut(stringify(cmd));
}, repeatWhileVisible = (matcher, func) => {
const out = handleNest(func, !0);
addOut(stringify([
{ repeat: { times: 10, while: { visible: matcher }, commands: out } }
]));
}, repeatWhileNotVisible = (matcher, func) => {
const out = handleNest(func, !0);
addOut(stringify([
{ repeat: { times: 10, while: { notVisible: matcher }, commands: out } }
]));
};
export {
repeat,
repeatWhileNotVisible,
repeatWhileVisible
};