Created
December 28, 2020 20:42
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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