Skip to content

Commit

Permalink
refactor(stripEndings): use less conditionals in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
bhajneet committed Nov 2, 2020
1 parent 6401423 commit 6233c87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/stripEndings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const matchers = [
` ?${endingClass} ?${pauseGroup}.*`,
// Any ending followed by any number => match the rest of the line
` ?(${endingClass}|${optionalEndingClass})${numberClass}.*`,
// Any numbers at the end of a line
` ?(${numberClass}+([ .]+)?(${numberClass}+)?$)`,
// Any sequence at the end of a line with numbers, periods, and spaces beginning with a number
` ?${numberClass}(${numberClass}|[. ])*$`,
// Clean up any lingering ending characters
` ?${brokenEndingClass}`,
` ?${endingClass}`,
Expand Down

0 comments on commit 6233c87

Please sign in to comment.