({ id, uri, meta, removed })
| 255 | |
| 256 | /** @return {?VMScript} */ |
| 257 | export function getScript({ id, uri, meta, removed }) { |
| 258 | let script; |
| 259 | if (id) { |
| 260 | script = getScriptById(id); |
| 261 | } else { |
| 262 | if (!uri) uri = getNameURI({ meta, props: { id: '@@should-have-name' } }); |
| 263 | script = (removed ? removedScripts : aliveScripts).find(({ props }) => uri === props.uri); |
| 264 | } |
| 265 | return script; |
| 266 | } |
| 267 | |
| 268 | /** @return {VMScript[]} */ |
| 269 | export function getScripts() { |
no test coverage detected