hensei-web/node_modules/parcel-bundler/lib/utils/is-url.js
2020-09-11 06:44:42 -07:00

12 lines
No EOL
328 B
JavaScript

"use strict";
const isURL = require('is-url'); // Matches anchor (ie: #raptors)
const ANCHOR_REGEXP = /^#/; // Matches scheme (ie: tel:, mailto:, data:, itms-apps:)
const SCHEME_REGEXP = /^[a-z][a-z0-9\-+.]*:/i;
module.exports = function (url) {
return isURL(url) || ANCHOR_REGEXP.test(url) || SCHEME_REGEXP.test(url);
};