7 lines
152 B
JavaScript
Raw Normal View History

2025-08-01 11:39:06 +08:00
'use strict';
module.exports = function parseProtocol(url) {
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
return match && match[1] || '';
};