Skip to content

Commit

Permalink
feat: Add support for Regexp for ignorePaths option
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
paulgv committed Mar 10, 2018
1 parent 2c84f8d commit 65f8b45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const generateRoutes = ({
const localizedRoutes = []
// Extract routes that should not be localized
baseRoutes.forEach(route => {
if (ignorePaths.indexOf(route.path) !== -1) {
const isIgnoredPath = (-1 !== ignorePaths.findIndex(pattern => {
const regexp = new RegExp(pattern)
return route.path.match(pattern)
}))
if (isIgnoredPath) {
newRoutes.push(route)
} else {
localizedRoutes.push(route)
Expand Down

0 comments on commit 65f8b45

Please sign in to comment.