Skip to content

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

Merged
renbaoshuo merged 1 commit intohexojs:masterfrom
yoshinorin:refactor/use-UL-instead-of-url.resolve
Dec 31, 2022
Merged

refactor: use the WHATWG URL API instead of url.resolve#5136
renbaoshuo merged 1 commit intohexojs:masterfrom
yoshinorin:refactor/use-UL-instead-of-url.resolve

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.

3 participants