1 | ;
|
2 |
|
3 | const isURL = require('is-url'); // Matches anchor (ie: #raptors)
|
4 |
|
5 |
|
6 | const ANCHOR_REGEXP = /^#/; // Matches scheme (ie: tel:, mailto:, data:, itms-apps:)
|
7 |
|
8 | const SCHEME_REGEXP = /^[a-z][a-z0-9\-+.]*:/i;
|
9 |
|
10 | module.exports = function (url) {
|
11 | return isURL(url) || ANCHOR_REGEXP.test(url) || SCHEME_REGEXP.test(url);
|
12 | }; |
\ | No newline at end of file |