Refactor: use Array.includes instead of indexOf (#366)

This commit is contained in:
James George 2019-12-15 23:24:34 +05:30 committed by Pranav Raj S
parent a7cb75e468
commit 5c7c325c9c

View file

@ -103,7 +103,7 @@ export default {
for (let i = 0; i < groupKey.length; i += 1) { for (let i = 0; i < groupKey.length; i += 1) {
const groupItem = this.sidebarList[groupKey[i]]; const groupItem = this.sidebarList[groupKey[i]];
// Check if current route is included // Check if current route is included
const isRouteIncluded = groupItem.routes.indexOf(currentRoute) > -1; const isRouteIncluded = groupItem.routes.includes(currentRoute);
if (isRouteIncluded) { if (isRouteIncluded) {
menuItems = Object.values(groupItem.menuItems); menuItems = Object.values(groupItem.menuItems);
} }