(runtime: IRuntime)
| 59 | } |
| 60 | |
| 61 | isValidRuntime(runtime: IRuntime) { |
| 62 | if (typeof runtime !== 'object' || Array.isArray(runtime)) { |
| 63 | return false; |
| 64 | } |
| 65 | |
| 66 | return this.builtinModules.every((m) => { |
| 67 | const flag = !!runtime[m]; |
| 68 | if (!flag) { |
| 69 | throw new Error(`runtime is invalid, module '${m}' does not exist`); |
| 70 | } |
| 71 | return flag; |
| 72 | }); |
| 73 | } |
| 74 | |
| 75 | getRuntime() { |
| 76 | return this.runtime; |
no test coverage detected