Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency path-to-regexp to v7 - autoclosed #1400

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 21, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
path-to-regexp 0.2.5 -> 7.1.0 age adoption passing confidence

Release Notes

pillarjs/path-to-regexp (path-to-regexp)

v7.1.0: Strict mode

Compare Source

Added

  • Adds a strict option to detect potential ReDOS issues

Fixed

  • Fixes separator to default to suffix + prefix when not specified
  • Allows separator to be undefined in TokenData
    • This is only relevant if you are building TokenData manually, previously parse filled it in automatically

Comments

  • I highly recommend enabling strict: true and I'm probably releasing a V8 with it enabled by default ASAP as a necessary security mitigation

v7.0.0: Wildcard, unicode, and modifier changes

Compare Source

Hi all! There's a few major breaking changes in this release so read carefully.

Breaking changes:

  • The function returned by compile only accepts strings as values (i.e. no numbers, use String(value) before compiling a path)
    • For repeated values, when encode !== false, it must be an array of strings
  • Parameter names can contain all unicode identifier characters (defined as regex \p{XID_Continue}).
  • Modifiers (?, *, +) must be used after a param explicitly wrapped in {}
    • No more implied prefix of / or .
  • No support for arrays or regexes as inputs
  • The wildcard (standalone *) has been added back and matches Express.js expected behavior
  • Removed endsWith option
  • Renamed strict: true to trailing: false
  • Reserved ;, ,, !, and @ for future use-cases
  • Removed tokensToRegexp, tokensToFunction and regexpToFunction in favor of simplifying exports
  • Enable a "loose" mode by default, so / can be repeated multiple times in a matched path (i.e. /foo works like //foo, etc)
  • encode and decode no longer receive the token as the second parameter
  • Removed the ESM + CommonJS dual package in favor of only one CommonJS supported export
  • Minimum JS support for ES2020 (previous ES2015)
  • Encode defaults to encodeURIComponent and decode defaults to decodeURIComponent

Added:

  • Adds encodePath to fix an issue around encode being used for both path and parameters (the path and parameter should be encoded slightly differently)
  • Adds loose as an option to support arbitrarily matching the delimiter in paths, e.g. foo/bar and foo///bar should work the same
  • Allow encode and decode to be set to false which skips all processing of the parameters input/output
  • All remaining methods support TokenData (exported, returned by parse) as input
    • This should be useful if you are programmatically building paths to match or want to avoid parsing multiple times

Requests for feedback:

  • Requiring {} is an obvious drawback but I'm seeking feedback on whether it helps make path behavior clearer
    • Related: Removing / and . as implicit prefixes
  • Removing array and regex support is to reduce the overall package size for things many users don't need
  • Unicode IDs are added to align more closely with browser URLPattern behavior, which uses JS identifiers

v6.2.2: Updated README

Compare Source

No API changes. Documentation only release.

Changed

v6.2.1: Fix matching :name* parameter

Compare Source

Fixed

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

Added

v6.2.0: Named Capturing Groups

Compare Source

Added

  • Support named capturing groups for RegExps (#​225)

Fixed

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

v6.1.0: Use `/#?` as Default Delimiter

Compare Source

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: '.'

v6.0.0: Custom Prefix and Suffix Groups

Compare Source

Note: The path syntax has been stabilized with this release, no breaking changes in paths is expected.

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}?

v5.0.0: Remove Default Encode URI Component

Compare Source

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

v4.0.5: Decode URI

Compare Source

Removed

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

v4.0.4: Remove String#normalize

Compare Source

Fixed

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

v4.0.3: Normalize Path Whitelist

Compare Source

Added

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

v4.0.2: Allow RegexpOptions in match

Compare Source

Fixed

  • Allow RegexpOptions in match(...) function

v4.0.1: Fix Spelling of Regexp

Compare Source

Fixed

  • Normalize regexp spelling across 4.x

v4.0.0: ES2015 Package for Bundlers

Compare Source

All path rules are backward compatible with 3.x, except for nested () and other RegEx special characters that were previously ignored.

Changed

  • Export names have changed to support ES2015 modules in bundlers
  • match does not default to decodeURIComponent

Added

  • New normalizePathname utility for supporting unicode paths in libraries
  • Support nested non-capturing groups within parameters
  • Add tree-shaking (via ES2015 modules) for webpack and other bundlers

v3.2.0: Match Function

Compare Source

Added

  • Add native match function to library

v3.1.0: Validate and sensitive options

Compare Source

  • Add sensitive option for tokensToFunction (#​191)
  • Add validate option to path functions (#​178)

v3.0.0

Compare Source

  • Always use prefix character as delimiter token, allowing any character to be a delimiter (e.g. /:att1-:att2-:att3-:att4-:att5)
  • Remove partial support, prefer escaping the prefix delimiter explicitly (e.g. \\/(apple-)?icon-:res(\\d+).png)

v2.4.0

Compare Source

  • Support start option to disable anchoring from beginning of the string

v2.3.0

Compare Source

  • Use delimiter when processing repeated matching groups (e.g. foo/bar has no prefix, but has a delimiter)

v2.2.1

Compare Source

  • Allow empty string with end: false to match both relative and absolute paths

v2.2.0

Compare Source

  • Pass token as second argument to encode option (e.g. encode(value, token))

v2.1.0

Compare Source

  • Handle non-ending paths where the final character is a delimiter
    • E.g. /foo/ before required either /foo/ or /foo// to match in non-ending mode

v2.0.0

Compare Source

  • New option! Ability to set endsWith to match paths like /test?query=string up to the query string
  • New option! Set delimiters for specific characters to be treated as parameter prefixes (e.g. /:test)
  • Remove isarray dependency
  • Explicitly handle trailing delimiters instead of trimming them (e.g. /test/ is now treated as /test/ instead of /test when matching)
  • Remove overloaded keys argument that accepted options
  • Remove keys list attached to the RegExp output
  • Remove asterisk functionality (it's a real pain to properly encode)
  • Change tokensToFunction (e.g. compile) to accept an encode function for pretty encoding (e.g. pass your own implementation)

v1.8.0: Backport token to function options

Compare Source

Added

  • Backport TokensToFunctionOptions

v1.7.0

Compare Source

  • Allow a delimiter option to be passed in with tokensToRegExp which will be used for "non-ending" token match situations

v1.6.0

Compare Source

  • Populate RegExp.keys when using the tokensToRegExp method (making it consistent with the main export)
  • Allow a delimiter option to be passed in with parse
  • Updated TypeScript definition with Keys and Options updated

v1.5.3

Compare Source

  • Add \\ to the ignore character group to avoid backtracking on mismatched parens

v1.5.2

Compare Source

  • Escape \\ in string segments of regexp

v1.5.1

Compare Source

  • Add index.d.ts to NPM package

v1.5.0

Compare Source

  • Handle partial token segments (better)
  • Allow compile to handle asterisk token segments

v1.4.0

Compare Source

  • Handle RegExp unions in path matching groups

v1.3.0

Compare Source

  • Clarify README language and named parameter token support
  • Support advanced Closure Compiler with type annotations
  • Add pretty paths options to compiled function output
  • Add TypeScript definition to project
  • Improved prefix handling with non-complete segment parameters (E.g. /:foo?-bar)

v1.2.1

Compare Source

  • Encode values before validation with path compilation function
  • More examples of using compilation in README

v1.2.0

Compare Source

  • Add support for matching an asterisk (*) as an unnamed match everything group ((.*))

v1.1.1

Compare Source

  • Expose methods for working with path tokens

v1.1.0

Compare Source

  • Expose the parser implementation to consumers
  • Implement a compiler function to generate valid strings
  • Huge refactor of tests to be more DRY and cover new parse and compile functions
  • Use chai in tests
  • Add .editorconfig

v1.0.3

Compare Source

  • Optimised function runtime
  • Added files to package.json

v1.0.2

Compare Source

  • Use Array.isArray shim
  • Remove ES5 incompatible code
  • Fixed repository path
  • Added new readme badges

v1.0.1

Compare Source

  • Ensure installation works correctly on 0.8

v1.0.0

Compare Source

  • No more API changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/path-to-regexp-7.x branch from c28a375 to d06880b Compare July 14, 2024 00:41
@renovate renovate bot changed the title fix(deps): update dependency path-to-regexp to v7 fix(deps): update dependency path-to-regexp to v7 - autoclosed Sep 1, 2024
@renovate renovate bot closed this Sep 1, 2024
@renovate renovate bot deleted the renovate/path-to-regexp-7.x branch September 1, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants