Skip to content

Releases: pillarjs/path-to-regexp

Fix matching `:name*` parameter

Choose a tag to compare

@blakeembrey blakeembrey released this 06 May 22:01
b0778f5

Fixed

  • Fix invalid matching of :name* parameter (#261) 762bc6b
  • Compare delimiter string over regexp 86baef8

Added

v6.2.0...v6.2.1

Named Capturing Groups

Choose a tag to compare

@blakeembrey blakeembrey released this 29 Sep 17:24

Added

  • Support named capturing groups for RegExps (#225)

Fixed

  • Update strict flag documentation (#227)
  • Ignore test files when bundling (#220)

Use `/#?` as Default Delimiter

Choose a tag to compare

@blakeembrey blakeembrey released this 20 Nov 19:27

Fixed

  • Use /#? as default delimiter to avoid matching on query or fragment parameters
    • If you are matching non-paths (e.g. hostnames), you can adjust delimiter: '.'

Custom Prefix and Suffix Groups

Choose a tag to compare

@blakeembrey blakeembrey released this 20 Nov 04:17

This release reverts the prefix behavior added in v3 back to the behavior seen in v2. For the most part, path matching is backward compatible with v2 with these enhancements:

  1. Support for nested non-capturing groups in regexp, e.g. /(abc(?=d))
  2. Support for custom prefix and suffix groups using /{abc(.*)def}
  3. Tokens in an unexpected position will throw an error
    • Paths like /test(foo previously worked treating ( as a literal character, now it expects ( to be closed and is treated as a group
    • You can escape the character for the previous behavior, e.g. /test\(foo

Changed

  • Revert using any character as prefix, support prefixes option to configure this (starts as /. which acts like every version since 0.x again)
  • Add support for {} to capture prefix/suffix explicitly, enables custom use-cases like /:attr1{-:attr2}?

Remove Default Encode URI Component

Choose a tag to compare

@blakeembrey blakeembrey released this 12 Nov 12:05

No changes to path rules since 3.x, except support for nested RegEx parts in 4.x.

Changed

  • Rename RegexpOptions interface to TokensToRegexpOptions
  • Remove normalizePathname from library, document solution in README
  • Encode using identity function as default, not encodeURIComponent

Decode URI

Choose a tag to compare

@blakeembrey blakeembrey released this 12 Nov 11:39

Removed

  • Remove whitelist in favor of decodeURI (advanced behavior can happen outside path-to-regexp)

Remove `String#normalize`

Choose a tag to compare

@blakeembrey blakeembrey released this 12 Nov 07:20

Fixed

  • Remove usage of String.prototype.normalize to continue supporting IE

Normalize Path Whitelist

Choose a tag to compare

@blakeembrey blakeembrey released this 12 Nov 06:54

Added

  • Add normalize whitelist of characters (defaults to /%.-)

Allow `RegexpOptions` in `match`

Choose a tag to compare

@blakeembrey blakeembrey released this 12 Nov 04:35

Fixed

  • Allow RegexpOptions in match(...) function

Fix Spelling of Regexp

Choose a tag to compare

@blakeembrey blakeembrey released this 12 Nov 04:10

Fixed

  • Normalize regexp spelling across 4.x