mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
443 B
TypeScript
11 lines
443 B
TypeScript
import { URI } from 'uri-template-lite';
|
|
|
|
// Call `expand` directly
|
|
const dataSet = { domain: "example.com", user: "fred", query: "mycelium" };
|
|
URI.expand("http://{domain}/~{user}/foo{?query,number}", dataSet);
|
|
|
|
const template = new URI.Template("http://{domain}/~{user}/foo{?query,number}");
|
|
template.expand(dataSet);
|
|
template.match("http://example.com/~fred/foo?query=mycelium&number=3");
|
|
template.match("http://other.com/?query=mycelium");
|