window.hubl.getRoute = (type, returnFirst = false) => { let availables = window.hubl.components.filter(c => c.type == type || c.uniq == type); if (availables.length > 1) { if (returnFirst) { return availables[0].route; } else { console.error(`Too much components availables for route ${type}`); } } else if (availables.length < 1) { console.error(`No component found for route ${type}`); } else { return availables[0].route; } }