1 | export interface Options {
|
2 | /**
|
3 | Prepend `https://` instead of `http://`.
|
4 |
|
5 | @default true
|
6 | */
|
7 | readonly https?: boolean;
|
8 | }
|
9 |
|
10 | /**
|
11 | Prepend `https://` to humanized URLs like `sindresorhus.com` and `localhost`.
|
12 |
|
13 | @param url - The URL to prepend `https://` to.
|
14 |
|
15 | @example
|
16 | ```
|
17 | import prependHttp from 'prepend-http';
|
18 |
|
19 | prependHttp('sindresorhus.com');
|
20 | //=> 'https://sindresorhus.com'
|
21 |
|
22 | prependHttp('localhost', {https: false});
|
23 | //=> 'http://localhost'
|
24 |
|
25 | prependHttp('https://sindresorhus.com');
|
26 | //=> 'https://sindresorhus.com'
|
27 | ```
|
28 | */
|
29 | export default function prependHttp(url: string, options?: Options): string;
|