-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update APIs #20
Merged
Merged
Update APIs #20
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
144a2a7
Move files into Old module
JordanMartinez e57cbc8
Add deps on prelude and effect
JordanMartinez 8b991fb
Implement bindings for URL
JordanMartinez 89a0242
Add bindings to UrlSearchParams
JordanMartinez 9b7960c
Finish implementing URL bindings
JordanMartinez cb44328
Add both variants of format
JordanMartinez ff2c01f
Update export lists to exclude FFI
JordanMartinez 2fbb790
Update tests
JordanMartinez e33cbfd
Add changelog entry
JordanMartinez 53de379
Add entry for queryString droppage
JordanMartinez 0cffdf3
Update CI actions/node; add purs-tidy
JordanMartinez 8826021
Drop old bindings
JordanMartinez b8dcd3e
Fix lint error
JordanMartinez 6b578c5
Merge branch 'master' into update-apis
JordanMartinez 5075a0a
Fix remaining eslint issues
JordanMartinez b03a515
Add another entry
JordanMartinez 37d33d5
Make next release entry
JordanMartinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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 |
---|---|---|
@@ -1,10 +1,58 @@ | ||
import url from "url"; | ||
import queryString from "querystring"; | ||
export { parse, format } from "url"; | ||
import url from "node:url"; | ||
|
||
export function resolve(from) { | ||
return to => url.resolve(from, to); | ||
} | ||
export const newImpl = (input) => new url.URL(input); | ||
export const newRelativeImpl = (input, base) => new url.URL(input, base); | ||
export const pathToFileURLImpl = (path) => url.pathToFileURL(path); | ||
export const hashImpl = (u) => u.hash; | ||
export const setHashImpl = (h, u) => { | ||
u.hash = h; | ||
}; | ||
export const hostImpl = (url) => url.host; | ||
export const setHostImpl = (val, u) => { | ||
u.host = val; | ||
}; | ||
export const hostnameImpl = (u) => u.hostname; | ||
export const setHostnameImpl = (val, u) => { | ||
u.hostname = val; | ||
}; | ||
export const uneffectfulHref = (u) => u.href; | ||
export const hrefImpl = (u) => u.href; | ||
export const setHrefImpl = (val, u) => { | ||
u.href = val; | ||
}; | ||
export const origin = (u) => u.origin; | ||
export const passwordImpl = (u) => u.password; | ||
export const setPasswordImpl = (val, u) => { | ||
u.password = val; | ||
}; | ||
export const pathnameImpl = (u) => u.pathname; | ||
export const setPathnameImpl = (val, u) => { | ||
u.pathname = val; | ||
}; | ||
export const portImpl = (u) => u.port; | ||
export const setPortImpl = (val, u) => { | ||
u.port = val; | ||
}; | ||
export const protocolImpl = (u) => u.protocol; | ||
export const setProtocolImpl = (val, u) => { | ||
u.protocol = val; | ||
}; | ||
export const searchImpl = (u) => u.search; | ||
export const setSearchImpl = (val, u) => { | ||
u.search = val; | ||
}; | ||
export const searchParamsImpl = (u) => u.searchParams; | ||
export const usernameImpl = (u) => u.username; | ||
export const setUsernameImpl = (val, u) => { | ||
u.username = val; | ||
}; | ||
|
||
export const parseQueryString = queryString.parse; | ||
export const toQueryString = queryString.stringify; | ||
export const canParseImpl = (input, base) => url.URL.canParse(input, base); | ||
export const domainToAsciiImpl = (domain) => url.domainToASCII(domain); | ||
export const domainToUnicodeImpl = (domain) => url.domainToUnicode(domain); | ||
export const fileURLToPathImpl = (str) => url.fileURLToPath(str); | ||
export const fileURLToPathUrlImpl = (str) => url.fileURLToPath(str); | ||
export const formatImpl = (theUrl) => url.format(theUrl); | ||
export const formatOptsImpl = (theUrl, opts) => url.format(theUrl, opts); | ||
export const pathToFileUrlImpl = (path) => url.pathToFileURL(path); | ||
export const urlToHttpOptionsImpl = (theUrl) => url.urlToHttpOptions(theUrl); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be hrefPure? I think that’s a more common naming convention than “uneffectful”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that name better. I'll send a PR.