(prompts)
| 1641 | |
| 1642 | // returns how many prompts would have to be made with the given prompts |
| 1643 | function applyPermuteOperatorNumber(prompts) { |
| 1644 | // prompts is array of input, trimmed, filtered and split by \n |
| 1645 | let numberOfPrompts = 0 |
| 1646 | prompts.forEach((prompt) => { |
| 1647 | let promptCounter = 1 |
| 1648 | let promptMatrix = prompt.split("|") |
| 1649 | promptMatrix.shift() |
| 1650 | |
| 1651 | promptMatrix = promptMatrix.map((p) => p.trim()) |
| 1652 | promptMatrix = promptMatrix.filter((p) => p !== "") |
| 1653 | |
| 1654 | if (promptMatrix.length > 0) { |
| 1655 | promptCounter *= permuteNumber(promptMatrix) |
| 1656 | } |
| 1657 | numberOfPrompts += promptCounter |
| 1658 | }) |
| 1659 | |
| 1660 | return numberOfPrompts |
| 1661 | } |
| 1662 | |
| 1663 | function permutePrompts(promptBase, promptMatrix) { |
| 1664 | let prompts = [] |
no test coverage detected