path-to-regexp icon indicating copy to clipboard operation
path-to-regexp copied to clipboard

Add back `keys` property to regex

Open nickyu42 opened this issue 3 years ago • 2 comments

See issue #236

The returned regex object from pathToRegex used to include the modified keys array as a keys property in v1.7.0. The current API is not entirely ideal, since a keys array must be passed, we could instead use a more functional API without mutation.

In the future this should be changed that no array needs to be passed to pathToRegex, adding it as a property this way is done to maintain backwards compatibility.

nickyu42 avatar Mar 08 '22 11:03 nickyu42

We'll also need a simple couple of tests to ensure we don't regress but otherwise LGTM 😄

blakeembrey avatar Mar 09 '22 06:03 blakeembrey

Codecov Report

Merging #272 (845c7fb) into master (762bc6b) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #272   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          246       250    +4     
  Branches        98        98           
=========================================
+ Hits           246       250    +4     
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)

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 762bc6b...845c7fb. Read the comment docs.

codecov[bot] avatar Mar 09 '22 06:03 codecov[bot]