1 | /**
|
2 | * Transform an URL to a valid origin value.
|
3 | *
|
4 | * @param url URL to transform to it's origin.
|
5 | * @returns The origin.
|
6 | * @api public
|
7 | */
|
8 | declare function origin(url: string | object | { protocol: string; host: string }): string;
|
9 |
|
10 | declare namespace origin {
|
11 | /**
|
12 | * Check if the origins are the same.
|
13 | *
|
14 | * @param a URL or origin of a.
|
15 | * @param b URL or origin of b.
|
16 | * @returns true if origins are the same, false otherwise
|
17 | * @api public
|
18 | */
|
19 | function same(a: string, b: string): boolean;
|
20 | }
|
21 |
|
22 | export = origin;
|