Function
init
(options?: ConfigOptions)
Source from the content-addressed store, hash-verified
| 54 | let isInit = false |
| 55 | |
| 56 | export const init = async (options?: ConfigOptions) => { |
| 57 | await destroy() |
| 58 | |
| 59 | if (options) { |
| 60 | config.setEngineOptions(options) |
| 61 | } |
| 62 | |
| 63 | logger.info('plugins extending...') |
| 64 | await plugins.extend() |
| 65 | |
| 66 | logger.info('plugins initing...') |
| 67 | await plugins.init() |
| 68 | |
| 69 | isInit = true |
| 70 | logger.info('Engine initialization successfully') |
| 71 | } |
| 72 | |
| 73 | export const destroy = async () => { |
| 74 | if (!isInit) return |
Tested by
no test coverage detected