mirror of
https://github.com/D4M13N-D3V/comissions-app-ui.git
synced 2025-03-14 08:15:08 +00:00
20 lines
496 B
TypeScript
20 lines
496 B
TypeScript
![]() |
// ** Types
|
||
|
import { NextRouter } from 'next/router'
|
||
|
|
||
|
/**
|
||
|
* Check for URL queries as well for matching
|
||
|
* Current URL & Item Path
|
||
|
*
|
||
|
* @param item
|
||
|
* @param activeItem
|
||
|
*/
|
||
|
export const handleURLQueries = (router: NextRouter, path: string | undefined): boolean => {
|
||
|
if (Object.keys(router.query).length && path) {
|
||
|
const arr = Object.keys(router.query)
|
||
|
|
||
|
return router.asPath.includes(path) && router.asPath.includes(router.query[arr[0]] as string) && path !== '/'
|
||
|
}
|
||
|
|
||
|
return false
|
||
|
}
|