export function hasChildren(item: any) { const { sublinks: children } = item; if (children === undefined) { return false; } if (children.constructor !== Array) { return false; } if (children.length === 0) { return false; } return true; } export const checkIfAnyActiveChild = (child: any, location: any) => { return child.some((item: any) => ( item?.isSubLinks ? item?.sublinks?.some((item: any) => item.url == location?.pathname) : item.url == location?.pathname )) }