Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -737,18 +737,16 @@ against a pattern.
const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/*.html');
console.log(myPattern.exec('https://nodejs.org/docs/latest/api/dns.html'));
// Prints:
// {
// "hash": { "groups": { "0": "" }, "input": "" },
// "hostname": { "groups": {}, "input": "nodejs.org" },
// "inputs": [
// "https://nodejs.org/docs/latest/api/dns.html"
// ],
// "password": { "groups": { "0": "" }, "input": "" },
// "pathname": { "groups": { "0": "dns" }, "input": "/docs/latest/api/dns.html" },
// "port": { "groups": {}, "input": "" },
// "protocol": { "groups": {}, "input": "https" },
// "search": { "groups": { "0": "" }, "input": "" },
// "username": { "groups": { "0": "" }, "input": "" }
// [Object: null prototype] {
// inputs: [ 'https://nodejs.org/docs/latest/api/dns.html' ],
// protocol: { input: 'https', groups: {} },
// username: { input: '', groups: { '0': '' } },
// password: { input: '', groups: { '0': '' } },
// hostname: { input: 'nodejs.org', groups: {} },
// port: { input: '', groups: {} },
// pathname: { input: '/docs/latest/api/dns.html', groups: { '0': 'dns' } },
// search: { input: '', groups: { '0': '' } },
// hash: { input: '', groups: { '0': '' } }
// }

console.log(myPattern.test('https://nodejs.org/docs/latest/api/dns.html'));
Expand Down Expand Up @@ -811,18 +809,16 @@ matched input and matched groups.
const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/*.html');
console.log(myPattern.exec('https://nodejs.org/docs/latest/api/dns.html'));
// Prints:
// {
// "hash": { "groups": { "0": "" }, "input": "" },
// "hostname": { "groups": {}, "input": "nodejs.org" },
// "inputs": [
// "https://nodejs.org/docs/latest/api/dns.html"
// ],
// "password": { "groups": { "0": "" }, "input": "" },
// "pathname": { "groups": { "0": "dns" }, "input": "/docs/latest/api/dns.html" },
// "port": { "groups": {}, "input": "" },
// "protocol": { "groups": {}, "input": "https" },
// "search": { "groups": { "0": "" }, "input": "" },
// "username": { "groups": { "0": "" }, "input": "" }
// [Object: null prototype] {
// inputs: [ 'https://nodejs.org/docs/latest/api/dns.html' ],
// protocol: { input: 'https', groups: {} },
// username: { input: '', groups: { '0': '' } },
// password: { input: '', groups: { '0': '' } },
// hostname: { input: 'nodejs.org', groups: {} },
// port: { input: '', groups: {} },
// pathname: { input: '/docs/latest/api/dns.html', groups: { '0': 'dns' } },
// search: { input: '', groups: { '0': '' } },
// hash: { input: '', groups: { '0': '' } }
// }
```

Expand Down
Loading