@sls-next/core
Version:
Handles Next.js routing independent of provider
10 lines (8 loc) • 311 B
text/typescript
export const isDynamicRoute = (route: string): boolean => {
// Identify /[param]/ in route string
return /\/\[[^\/]+?](?=\/|$)/.test(route);
};
export const isOptionalCatchAllRoute = (route: string): boolean => {
// Identify /[[param]]/ in route string
return /\/\[\[[^\/]+?]](?=\/|$)/.test(route);
};