Skip to content

feat: Allow RegExg flags to be configured through module options #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

Refused
Copy link

@Refused Refused commented Apr 4, 2019

Request title says it all.

export default {
  modules: [
    // Module using defaults
    '@nuxtjs/redirect-module'

    // Module using passed in RegEx flags
    ['@nuxtjs/redirect-module', { flags: 'i' }]
  ]
}

@codecov
Copy link

codecov bot commented Apr 4, 2019

Codecov Report

Merging #38 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #38   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          33     33           
  Branches        8      8           
=====================================
  Hits           33     33
Impacted Files Coverage Δ
lib/module.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dd6f01...267df30. Read the comment docs.

@TheAlexLichter
Copy link
Member

Hey 👋
Thanks for the PR!

A few things:

  1. Why having a global flags variable and not defining it locally/per regex? You can also pass in regex values like /abc/i at the moment.
  2. Docs are missing
  3. Tests are missing

Copy link
Member

@ricardogobbosouza ricardogobbosouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, as @manniL said, I find it unnecessary to add this flag.
In next major release #37 we are thinking of using path-to-regexp, the same as vue-router uses to have a redirection pattern

@TheAlexLichter
Copy link
Member

Stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants