1 | // Type definitions for original 1.0
|
2 | // Project: https://github.com/unshiftio/original
|
3 | // Definitions by: Wayne Carson <https://github.com/wcarson>
|
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
5 | // TypeScript Version: 2.2
|
6 |
|
7 | /**
|
8 | * Transform an URL to a valid origin value.
|
9 | *
|
10 | * @param url URL to transform to it's origin.
|
11 | * @returns The origin.
|
12 | * @api public
|
13 | */
|
14 | declare function origin(url: string | object | { protocol: string; host: string }): string;
|
15 |
|
16 | declare namespace origin {
|
17 | /**
|
18 | * Check if the origins are the same.
|
19 | *
|
20 | * @param a URL or origin of a.
|
21 | * @param b URL or origin of b.
|
22 | * @returns true if origins are the same, false otherwise
|
23 | * @api public
|
24 | */
|
25 | function same(a: string, b: string): boolean;
|
26 | }
|
27 |
|
28 | export = origin;
|