2.2.1 • Published 7 months ago

router-path v2.2.1

Weekly downloads
27
License
ISC
Repository
-
Last release
7 months ago

Utility function that replaces the params from a route template with the values of an object to create a valid route path. Designed for, but not limited to, React-router.

It supports both colons (:) and brackets ([]) as param delimiters.

Example with colons:

createPath('/foo/:bar', { bar: 'test' });

returns

'/foo/test'

Example with brackets:

createPath('user/[id]/[slug]', { id: 1, slug: 'john-do' });

returns

'user/1/john-do'

2.2.1

7 months ago

2.2.0

7 months ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago