Skip to content

Commit

Permalink
optimise the req regex
Browse files Browse the repository at this point in the history
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*$/
```
  • Loading branch information
JakeChampion committed Jul 14, 2020
1 parent 8aab533 commit 133e490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/annotation/annotations/property.js
@@ -1,4 +1,4 @@
const reqRegEx = /\s*(?:\{(.*)\})?\s*(?:(\$?[^\s]+))?\s*(?:\[([^\]]*)\])?\s*(?:-?\s*([\s\S]*))\s*$/
const reqRegEx = /\s*(?:{(.*)})?\s*(?:(\$?\S+))?\s*(?:\[([^\]]*)])?\s*-?\s*([\S\s]*)\s*$/

export default function property () {
return {
Expand Down

0 comments on commit 133e490

Please sign in to comment.