Skip to content
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

optimise the req regex #551

Merged
merged 1 commit into from Aug 21, 2020
Merged

optimise the req regex #551

merged 1 commit into from Aug 21, 2020

Conversation

JakeChampion
Copy link
Contributor

This was optimised by the regexp-tree-cli package like so:

> npx regexp-tree-cli -o -e '/\s*(?:\{(.*)\})?\s*(?:(\$?[^\s]+))?\s*(?:\[([^\]]*)\])?\s*(?:-?\s*([\s\S]*))\s*$/'
 Optimized: /\s*(?:{(.*)})?\s*(?:(\$?\S+))?\s*(?:\[([^\]]*)])?\s*-?\s*([\S\s]*)\s*$/

This was optimised by the regexp-tree-cli package like so:
```
> npx regexp-tree-cli -o -e '/\s*(?:\{(.*)\})?\s*(?:(\$?[^\s]+))?\s*(?:\[([^\]]*)\])?\s*(?:-?\s*([\s\S]*))\s*$/'
 Optimized: /\s*(?:{(.*)})?\s*(?:(\$?\S+))?\s*(?:\[([^\]]*)])?\s*-?\s*([\S\s]*)\s*$/
```
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.752% when pulling 133e490 on JakeChampion:patch-1 into 8aab533 on SassDoc:master.

@pascalduez
Copy link
Member

Hi @JakeChampion,

interesting.
Could you provide a bit more insight on why this would be beneficial, what are you trying to fix or improve etc. ?

@JakeChampion
Copy link
Contributor Author

The original regex was harder to read due to all the extra escaping of characters which didn't need to be escaped.

Copy link
Member

@pascalduez pascalduez left a comment

Choose a reason for hiding this comment

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

Thanks!

@pascalduez pascalduez merged commit d39d265 into SassDoc:master Aug 21, 2020
@JakeChampion JakeChampion deleted the patch-1 branch August 21, 2020 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants