@wordpress/url
Version:
WordPress URL utilities.
15 lines • 413 B
TypeScript
/**
* Returns the protocol part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'
* const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'
* ```
*
* @return {string|void} The protocol part of the URL.
*/
export function getProtocol(url: string): string | void;
//# sourceMappingURL=get-protocol.d.ts.map