Urlpattern
URL Pattern Standard Options for constructing a URLPattern from individual component patterns.
Module:whatwg.urlpattern
Support: Experimental
Since: 1.1.0
Docs: WHATWG Docs
Dictionary URLPatternInit
Options for constructing a URLPattern from individual component patterns.
Since: 1.1.0 Docs: WHATWG Docs9 members: 9 undocumented
Properties
---
Dictionary URLPatternOptions
Options controlling URLPattern behavior.
Since: 1.1.0 Docs: WHATWG Docs1 members: 1 undocumented
Properties
---
Dictionary URLPatternComponentResult
The result of matching a single URL component against its pattern.
Since: 1.1.0 Docs: WHATWG Docs2 members: 2 undocumented
Properties
---
Dictionary URLPatternResult
The full result of executing a URLPattern against a URL.
Since: 1.1.0 Docs: WHATWG Docs9 members: 9 undocumented
Properties
---
Interface URLPattern
Matches URLs against a pattern composed of per-component matchers.
Since: 1.1.0 Docs: WHATWG Docs15 members: 15 undocumented
Constructors
Methods
Properties
---
Details
constructor(input, baseURL, options)
new constructor(input: string, baseURL?: string, options?: URLPatternOptions)
new constructor(input: string, baseURL?: string, options?: URLPatternOptions)
Construct a URLPattern from a pattern string and optional base URL.| Parameter | Type | Description |
|---|---|---|
input | string | A URL pattern string or an init dictionary specifying per-component patterns. |
baseURL (optional) | string | A base URL string used to resolve relative pattern strings. |
options (optional) | URLPatternOptions | Options controlling pattern behavior. |
TypeError--- If the pattern string is relative and no baseURL is provided.
constructor(input, options)
new constructor(input: URLPatternInit, options?: URLPatternOptions)
new constructor(input: URLPatternInit, options?: URLPatternOptions)
Construct a URLPattern from a pattern string and optional base URL.| Parameter | Type | Description |
|---|---|---|
input | URLPatternInit | A URL pattern string or an init dictionary specifying per-component patterns. |
options (optional) | URLPatternOptions | Options controlling pattern behavior. |
TypeError--- If the pattern string is relative and no baseURL is provided.
test(input, baseURL)
test(input?: string, baseURL?: string): boolean
test(input?: string, baseURL?: string): boolean
Test whether the given input matches this pattern.| Parameter | Type | Description |
|---|---|---|
input (optional) | string | A URL string or init dictionary to test against the pattern. |
baseURL (optional) | string | An optional base URL for resolving relative input strings. |
TypeError--- If input is an init dictionary and baseURL is also provided.
test(input)
test(input: URLPatternInit): boolean
test(input: URLPatternInit): boolean
Test whether the given input matches this pattern.| Parameter | Type | Description |
|---|---|---|
input | URLPatternInit | A URL string or init dictionary to test against the pattern. |
TypeError--- If input is an init dictionary and baseURL is also provided.
---