Skip to content

Commit

Permalink
Rename uneffectfulHref to hrefPure (#21)
Browse files Browse the repository at this point in the history
* Rename to hrefPure

* Add changelog entry
  • Loading branch information
JordanMartinez authored Aug 1, 2023
1 parent 3d1f35a commit 9c5a840
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ New features:
Bugfixes:

Other improvements:
- Rename `uneffectfulHref` to `hrefPure` (used in `Show` instance) (#21 by @JordanMartinez)

## [v7.0.0](https://github.com/purescript-node/purescript-node-url/releases/tag/v7.0.0) - 2023-07-31

Expand Down
2 changes: 1 addition & 1 deletion src/Node/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const hostnameImpl = (u) => u.hostname;
export const setHostnameImpl = (val, u) => {
u.hostname = val;
};
export const uneffectfulHref = (u) => u.href;
export const hrefPure = (u) => u.href;
export const hrefImpl = (u) => u.href;
export const setHrefImpl = (val, u) => {
u.href = val;
Expand Down
5 changes: 3 additions & 2 deletions src/Node/URL.purs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import Prim.Row as Row
foreign import data URL :: Type

instance Show URL where
show x = "URL(" <> uneffectfulHref x <> ")"
show x = "URL(" <> hrefPure x <> ")"

new :: String -> Effect URL
new input = runEffectFn1 newImpl input
Expand Down Expand Up @@ -96,7 +96,8 @@ setHostname val url = runEffectFn2 setHostnameImpl val url

foreign import setHostnameImpl :: EffectFn2 String URL Unit

foreign import uneffectfulHref :: URL -> String
-- do not export
foreign import hrefPure :: URL -> String

href :: URL -> Effect String
href url = runEffectFn1 hrefImpl url
Expand Down

0 comments on commit 9c5a840

Please sign in to comment.