hexo icon indicating copy to clipboard operation
hexo copied to clipboard

refactor: replace url.resolve() with String.replace()

Open curbengh opened this issue 3 years ago • 3 comments

What does it do?

url.resolve() is a legacy API, so it's best to avoid it if possible, String.replace() is also 6x faster.

How to test

git clone -b resolve-path-string-replace https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

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

curbengh avatar Aug 15 '20 10:08 curbengh

Coverage Status

Coverage decreased (-0.0009%) to 98.294% when pulling 27384cc49139156c51056a9f7a611c02882c54b2 on curbengh:resolve-path-string-replace into 463025c9d21411570e56b15812eb319ea0883330 on hexojs:master.

coveralls avatar Aug 15 '20 10:08 coveralls

Should we bring up a resolveURL in hexo-util?

SukkaW avatar Aug 15 '20 10:08 SukkaW

How to test

git clone -b resolve-path-string-replace https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

github-actions[bot] avatar Mar 27 '22 18:03 github-actions[bot]