@wordpress/url
Version:
WordPress URL utilities.
15 lines • 434 B
TypeScript
/**
* Tests if a url protocol is valid.
*
* @param {string} protocol The url protocol.
*
* @example
* ```js
* const isValid = isValidProtocol( 'https:' ); // true
* const isNotValid = isValidProtocol( 'https :' ); // false
* ```
*
* @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).
*/
export function isValidProtocol(protocol: string): boolean;
//# sourceMappingURL=is-valid-protocol.d.ts.map