Tests if an url is pointing to the same domain as the client or not.
Parameters:
Name | Type | Description |
---|---|---|
url | string | The url to test. |
- Since
- 1.0.0
- Source
Returns:
Whether the passed string is an external url or not.
- Type:
- boolean
Example
import { isExternalLink } from "@gravityforms/utils";
function Example() {
const url = 'https://some-url.com';
if ( isExternalLink( url ) ) {
// do something
}
}