Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async ready () {
// Call before hook
await this.nuxt.callHook('modules:before', this, this.options.modules)
if (this.options.devModules && !this.options._start) {
// Load every devModule in sequence
await sequence(this.options.devModules, this.addModule.bind(this))
}
// Load every module in sequence
await sequence(this.options.modules, this.addModule.bind(this))
// Call done hook
await this.nuxt.callHook('modules:done', this)
}
async ready () {
// Call before hook
await this.nuxt.callHook('modules:before', this, this.options.modules)
if (this.options.devModules && !this.options._start) {
// Load every devModule in sequence
await sequence(this.options.devModules, this.addModule.bind(this))
}
// Load every module in sequence
await sequence(this.options.modules, this.addModule.bind(this))
// Call done hook
await this.nuxt.callHook('modules:done', this)
}
async callHook (name, ...args) {
if (!this._hooks[name]) {
return
}
try {
await sequence(this._hooks[name], fn => fn(...args))
} catch (err) {
name !== 'error' && await this.callHook('error', err)
consola.fatal(err)
}
}