UNPKG

339 BTypeScriptView Raw
1/**
2Check if a URL is absolute.
3
4@param url - The URL to check.
5
6@example
7```
8import isAbsoluteUrl from 'is-absolute-url';
9
10isAbsoluteUrl('http://sindresorhus.com/foo/bar');
11//=> true
12
13isAbsoluteUrl('//sindresorhus.com');
14//=> false
15
16isAbsoluteUrl('foo/bar');
17//=> false
18```
19*/
20export default function isAbsoluteUrl(url: string): boolean;