Skip to content
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

refactor: use the WHATWG URL API instead of url.resolve #5136

Merged

Conversation

yoshinorin
Copy link
Member

@yoshinorin yoshinorin commented Dec 31, 2022

What does it do?

Closes: #4479

We just use new URL. No need to use String.replace() as #4479.

$ node

> new URL("/test", "https://example.com").pathname
'/test'
> new URL("test", "https://example.com").pathname
'/test'
> new URL("test", "https://example.com/").pathname
'/test'
> new URL("/test", "https://example.com/").pathname
'/test'

Screenshots

N/A

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@github-actions
Copy link

How to test

git clone -b refactor/use-UL-instead-of-url.resolve https://github.com/yoshinorin/hexo.git
cd hexo
npm install
npm test

@yoshinorin yoshinorin added this to the 7.0.0 milestone Dec 31, 2022
@coveralls
Copy link

Coverage Status

Coverage: 98.733% (-0.0007%) from 98.734% when pulling e03b621 on yoshinorin:refactor/use-UL-instead-of-url.resolve into d485ebd on hexojs:master.

@renbaoshuo renbaoshuo merged commit 4f2dde4 into hexojs:master Dec 31, 2022
@renbaoshuo renbaoshuo mentioned this pull request Dec 31, 2022
6 tasks
@yoshinorin yoshinorin deleted the refactor/use-UL-instead-of-url.resolve branch December 31, 2022 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants