new URLPattern(obj[, baseURL][, options])
-
obj<Object> 输入模式¥
obj<Object> An input pattern -
baseURL<string> | <undefined> 基本 URL 字符串¥
baseURL<string> | <undefined> A base URL string -
options<Object> 选项¥
options<Object> Options
将 Object 解析为输入模式,并使用它来实例化新的 URLPattern 对象。对象成员可以是 protocol、username、password、hostname、port、pathname、search、hash 或 baseURL 中的任意一个。
¥Parse the Object as an input pattern, and use it to instantiate a new
URLPattern object. The object members can be any of protocol, username,
password, hostname, port, pathname, search, hash or baseURL.
如果未指定 baseURL,则默认为 undefined。
¥If baseURL is not specified, it defaults to undefined.
选项可以具有 ignoreCase 布尔属性,如果设置为 true,则启用不区分大小写的匹配。
¥An option can have ignoreCase boolean attribute which enables
case-insensitive matching if set to true.
构造函数可以抛出 TypeError 来指示解析失败。
¥The constructor can throw a TypeError to indicate parsing failure.