-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readme: show get/getAll results for non-present key
- Loading branch information
Showing
2 changed files
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,8 @@ uri.query // → 'q=x&q=' | |
uri.fragment // → 'hash' | ||
uri.queryParams.get('q') // → 'x' | ||
uri.queryParams.getAll('q') // → ['x', ''] | ||
uri.queryParams.get('not-present') // → null | ||
uri.queryParams.getAll('not-present') // → [] | ||
// also available: href, origin, authority, userinfo, username, password, tld | ||
|
||
// relative path (not starting from root /) | ||
|
@@ -105,14 +107,15 @@ uri.protocol // → 'mailto' | |
uri.username // → '' | ||
uri.hostname // → '' | ||
uri.pathname // → '[email protected],[email protected]' | ||
uri.queryParams.get('subject') // → 'Hey' | ||
uri.query // → 'subject=Hey&body=Sign%20me%20up!' | ||
uri.queryParams.get('body') // → 'Sign me up!' | ||
|
||
// mailto in friendly mode | ||
uri = parseUri('mailto:[email protected]?subject=Hey', 'friendly'); | ||
uri.protocol // → 'mailto' | ||
uri.username // → 'me' | ||
uri.hostname // → 'my.com' | ||
uri.queryParams.get('subject') // → 'Hey' | ||
uri.pathname // → '' | ||
|
||
/* Also supports e.g.: | ||
- https://[2001:db8:85a3::7334%en1]/ipv6-with-zone-identifier | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters