Skip to content

Commit

Permalink
merge method arguments regex
Browse files Browse the repository at this point in the history
  • Loading branch information
d7my11 committed Nov 21, 2019
1 parent 238cf2c commit 3885abe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/typeRemover.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const methodArgumentHandler = (match) =>
match.split(',').map((arg) => arg.replace(/:.+/g, '')).join(',')

const rules = [
{ matcher: /(?<=\()([A-Za-z]*(?:\s)?:(?:\s)?[A-Za-z<>]*.*?)(?=\))/g, handler: methodArgumentHandler },
{ matcher: /(?<=\()(\n+)?(\s+)([A-Za-z\s\n]*(?:\s)?:(?:\s)?[A-Za-z<>,]*.*?)+(\n+)(?=\))/g, handler: methodArgumentHandler },
{ matcher: /(?<=\()(\n+)?(\s+)?([A-Za-z\s\n]*(?:\s)?:(?:\s)?[A-Za-z<>,]*.*?)+(\n+)?(?=\))/g, handler: methodArgumentHandler },
{ matcher: /(:[A-Za-z<>*,\s{}]*?)(?=(\s\=))/g }
]

Expand Down

0 comments on commit 3885abe

Please sign in to comment.