Skip to content

Home > sculp-js > isUrl

isUrl() function

判断字符串是否为 url 格式,支持 http、https、ftp 协议,支持域名或者 ipV4

Signature:

typescript
isUrl: (url: string, includeFtp?: boolean) => boolean

Parameters

Parameter

Type

Description

url

string

includeFtp

boolean

(Optional)

Returns:

boolean

{boolean}

Released under the MIT License.