(state: Collection[], script: Script)
| 535 | } |
| 536 | |
| 537 | function addScript(state: Collection[], script: Script): Collection[] { |
| 538 | return modifyCollection(state, script.collectionId, (c) => { |
| 539 | if (!c.scripts) c.scripts = []; |
| 540 | c.open = true; |
| 541 | c.scripts.splice(0, 0, script); |
| 542 | }); |
| 543 | } |
| 544 | |
| 545 | function deleteScript(state: Collection[], id: number): Collection[] { |
| 546 | const script = findScript(state, id); |
no test coverage detected