Parse protocol from URL.
从 URL 中解析协议。
The URL to parse the protocol from.
The protocol extracted from the URL.
If the URL is not a valid URL.
parseProtocol('http://example.com') // => httpparseProtocol('mailto:[email protected]') // => mailto Copy
parseProtocol('http://example.com') // => httpparseProtocol('mailto:[email protected]') // => mailto
Parse protocol from URL.
从 URL 中解析协议。