parseProtocol.js 152 B

123456
  1. 'use strict';
  2. module.exports = function parseProtocol(url) {
  3. var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  4. return match && match[1] || '';
  5. };