Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.08 KB

File metadata and controls

49 lines (36 loc) · 1.08 KB

match-path-arguments

Usage

npx react-router-v6-codemods match-path-arguments path/of/files/ or/some**/*glob.js

# or

yarn global add react-router-v6-codemods
react-router-v6-codemods match-path-arguments path/of/files/ or/some**/*glob.js

Local Usage

node ./bin/cli.js match-path-arguments path/of/files/ or/some**/*glob.js

Input / Output


basic

Input (basic.input.js):

const match = matchPath('/users/123', {
  path: '/users/:id',
  exact: true, // Optional, defaults to false
  strict: false, // Optional, defaults to false
});

Output (basic.output.js):

const match = matchPath({
  path: '/users/:id',
  caseSensitive: false, // Optional, defaults to false
  end: true, // Optional, defaults to false
}, '/users/123');