Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.

Releases: mswjs/node-match-path

v0.6.2

09 Apr 10:16

Choose a tag to compare

Bug fixes

  • Fixes a TypeScript issue where the params property of the match result wasn't annotated as potentially null (#39).

v0.6.1

22 Jan 16:13

Choose a tag to compare

Bug fixes

  • Fixes an issue when the return statement of the match function couldn't be properly type annotated in TypeScript (#34).
import { Match, match } from 'node-match-path'

const fn = (): Match => {
  return match(a, b)
}

v0.6.0

06 Nov 09:04

Choose a tag to compare

Breaking changes

  • The wildcard (*) now matches from zero to any amount of characters (previously from one to any) (#30, #31).
/user/details*
+/user/details
+/user/details0
+/user/details/arbitrary

v0.5.2

03 Nov 13:30

Choose a tag to compare

Bug fixes

  • Fixes an issue that resulted into a path parameter to match more than the respective portion of the path string (#28).
Expected: /user/:userId/suffix
-Used to match: /user/abc-123/suffix
-Used to match: /user/abc-123/arbitrary/segments/suffix
+Now matches only: /user/abc-123/suffix

v0.5.1

23 Sep 16:26

Choose a tag to compare

Bug fixes

  • Allows underscore (_) in the path parameter names (#26, #27).

v0.5.0

14 Sep 13:42

Choose a tag to compare

Breaking changes

  • Path matching is now case-insensitive (#24, #25).

v0.4.3

17 Jun 13:21

Choose a tag to compare

Bug fixes

  • Fixes an issue that produces an invalid match when given a path string with an extension: /files/:filename.json (#17, #18).
  • Updates dependencies (#19).

v0.4.1

24 Apr 07:56

Choose a tag to compare

Fixes

  • Fixes support of both path parameter and wildcard in a single path (#10, #13)
  • Fixes cases when having a one character long path parameter resulted into no parameter being matched (#12, #14)

v0.4.0

24 Apr 07:58

Choose a tag to compare

Breaking changes

  • Given a RegExp, the library now performs a weak match, giving you a full control over the match.
import { match } from 'node-match-path'

match(/\/user\//, 'https://my.api.com/user/any') // { "match": true }

Internal

  • Updates dependencies