Skip to content

Instantly share code, notes, and snippets.

@MaikelVeen
Created December 28, 2020 20:42
Show Gist options
  • Save MaikelVeen/379a1744c42da94349eaa81e28334b05 to your computer and use it in GitHub Desktop.
Save MaikelVeen/379a1744c42da94349eaa81e28334b05 to your computer and use it in GitHub Desktop.
Check wether or not a route in next.js is an internal route
const isNextInternalUrl = (path: string): boolean => {
return new RegExp(/[^\/]*^.[_]|(?:\[)/g).test(path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment