parseProtocol.js 151 B

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