UNPKG

408 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = isURL;
7
8const _isURL = require('is-url'); // Matches anchor (ie: #raptors)
9
10
11const ANCHOR_REGEXP = /^#/; // Matches scheme (ie: tel:, mailto:, data:, itms-apps:)
12
13const SCHEME_REGEXP = /^[a-z][a-z0-9\-+.]*:/i;
14
15function isURL(url) {
16 return _isURL(url) || ANCHOR_REGEXP.test(url) || SCHEME_REGEXP.test(url);
17}
\No newline at end of file