mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
URI.js
* expose `urijs/src/URITemplate` * expand `equals(url: string): boolean;` to `equals(url: string | URI): boolean;`
This commit is contained in:
@@ -42,4 +42,21 @@ URI('http://example.org/foo/hello.html').segment(['foo', 'bar', 'foobar.html']);
|
||||
var withDuplicates = URI("?bar=1&bar=1")
|
||||
.duplicateQueryParameters(true)
|
||||
.normalizeQuery()
|
||||
.toString();
|
||||
.toString();
|
||||
|
||||
/*
|
||||
To enable `URI.expand` when using `URI.js` via `npm`, include the following:
|
||||
|
||||
```
|
||||
import * as URI from "urijs";
|
||||
import * as URITemplate from "urijs/src/URITemplate";
|
||||
void URITemplate;
|
||||
```
|
||||
*/
|
||||
URI('http://user:pass@example.org:80/foo/bar.html?foo=bar&bar=baz#frag').equals(
|
||||
URI.expand('http://user:pass@example.org:80{/p*}{?q*}{#h}', {
|
||||
p: ["foo", "bar.html"],
|
||||
q: {foo: "bar", bar: "baz"},
|
||||
h: "frag"
|
||||
})
|
||||
);
|
||||
|
||||
8
urijs/URIjs.d.ts
vendored
8
urijs/URIjs.d.ts
vendored
@@ -27,11 +27,11 @@ declare module uri {
|
||||
domain(): string;
|
||||
domain(domain: boolean): string;
|
||||
domain(domain: string): URI;
|
||||
|
||||
|
||||
duplicateQueryParameters(val: boolean): URI;
|
||||
|
||||
equals(): boolean;
|
||||
equals(url: string): boolean;
|
||||
equals(url: string | URI): boolean;
|
||||
|
||||
filename(): string;
|
||||
filename(file: boolean): string;
|
||||
@@ -234,3 +234,7 @@ declare module 'URI' {
|
||||
declare module 'urijs' {
|
||||
export = URI;
|
||||
}
|
||||
|
||||
declare module 'urijs/src/URITemplate' {
|
||||
export = URI;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user