index.js 172 B

12345678
  1. 'use strict';
  2. module.exports = function (url) {
  3. if (typeof url !== 'string') {
  4. throw new TypeError('Expected a string');
  5. }
  6. return /^[a-z][a-z0-9+.-]*:/.test(url);
  7. };