I currently have a regex that looks like:
const ignoreRegex = new RegExp(/^\/(?!fonts|static).*$/)
However, I also have a dynamic array of strings like "test"
which need to be ignored too. I need to somehow map through this array and add each string to the regex, such that:
const ignoreRegex = new RegExp(/^\/(?!fonts|static + ignoreRoutes.map(x => `|${x}`) + ).*$/)
How do I do this?