'use strict';
var urlRegex = require('url-regex');
var re = new RegExp('^' + urlRegex().source + '$', 'i');

module.exports = function (url) {
	if (typeof url !== 'string') {
		throw new TypeError('Expected a string');
	}

	return re.test(url.trim());
};

'use strict';
var urlRegex = require('url-regex')({exact: true});

module.exports = function (url) {
	if (typeof url !== 'string') {
		throw new TypeError('Expected a string');
	}

	return urlRegex.test(url.trim());
};

Use the `exact` option in `url-regex`
Use the `exact` option in `url-regex`
