(num: number)
| 70 | } |
| 71 | |
| 72 | async function createEmptySteps(num: number): Promise<void> { |
| 73 | if (num < 1 || num > 1000) { |
| 74 | throw Error( |
| 75 | `No steps created. arg 'num' must be between 1 and 1000 inclusive` |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | const nextStepNum = getMetaData().challengeOrder.length + 1; |
| 80 | for (let stepNum = nextStepNum; stepNum < nextStepNum + num; stepNum++) { |
| 81 | const challengeId = new ObjectId(); |
| 82 | createStepFile({ stepNum, challengeId }); |
| 83 | await insertStepIntoMeta({ stepNum, stepId: challengeId }); |
| 84 | } |
| 85 | console.log(`Successfully added ${num} steps`); |
| 86 | } |
| 87 | |
| 88 | export { deleteStep, insertStep, createEmptySteps }; |
no test coverage detected