Skip to content

Commit

Permalink
docs: why use getUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
recursivefunk committed Jul 26, 2024
1 parent 15f00ce commit 5735235
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ Fetch `URL` objects from url strings
*/
```

Why would one use `env.getUrl()` if one just wishes to grab the url string value? The best reason to use `getUrl()` and grab the `origin` property is that `env.get()` doesn't care about the format of the value. Using `getUrl()` will ensure the url is properly formatted and return a `null` value if it isn't. In practice, having an _invalid_ url is the same as having no value at all. Then again, it's your code. Do what you want!

## Shortcut Methods

```javascript
Expand Down

0 comments on commit 5735235

Please sign in to comment.