mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 20:49:15 +00:00
improve
This commit is contained in:
@@ -25,8 +25,11 @@ const createFlow = (args) => {
|
||||
* @param {*} args
|
||||
* @returns
|
||||
*/
|
||||
const createProvider = (args) => {
|
||||
return new FlowClass(args)
|
||||
const createProvider = (providerClass = class {}) => {
|
||||
const providerInstance = new providerClass()
|
||||
if (!providerClass.prototype instanceof ProviderClass)
|
||||
throw new Error('El provider no implementa ProviderClass')
|
||||
return providerInstance
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user