0.4.1 • Published 9 months ago

@contentgrid/uri-template v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@contentgrid/uri-template

RFC 6570 compliant URI template parser and expander.

Usage

import UriTemplate from '@contentgrid/uri-template'

const template = new UriTemplate("http://example.com/{resource}/search{?color,height}");


// Expand using named keys
template.expand({ resource: "cars" }) // -> "http://example.com/cars/search"

// Expand using positional keys
template.expand(["cars", "blue"]) // -> "http://example.com/cars/search?color=blue"

// Parsing URLs
template.match("http://example.com/cars/search") // -> { resource: "cars" }
template.match("http://example.org/something-else") // -> null
0.4.1

9 months ago

0.4.0

12 months ago

0.3.0

1 year ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.1-alpha.6

2 years ago

0.0.1-alpha.5

2 years ago

0.0.1-alpha.0

2 years ago