refactor(bot): 🔥 refactor child nested cbs

This commit is contained in:
Leifer Mendez
2022-12-30 15:28:06 +01:00
parent 7d96a2c8d9
commit e54f1fff51

View File

@@ -49,7 +49,8 @@ const addAnswer =
* Esta funcion aplana y busca los callback anidados de los hijos
* @returns
*/
const getCbFromNested = () => flatObject(nested)
const getCbFromNested = () =>
flatObject(Array.isArray(nested) ? nested : [nested])
const callback = typeof cb === 'function' ? cb : () => null