hexo-util icon indicating copy to clipboard operation
hexo-util copied to clipboard

feat: joinPath()

Open curbengh opened this issue 3 years ago • 4 comments

ref: https://github.com/hexojs/hexo/pull/4479

this enhances path.join() to convert slash, but this joinPath() doesn't resolve '../' yet.

curbengh avatar Aug 16 '20 09:08 curbengh

Coverage Status

Coverage increased (+0.05%) to 97.476% when pulling c1295d6c77a58ecad58c897c1c32db2ea0e00ade on curbengh:join-path into bf42b664e717cbf81f338e8f67aad323797c336e on hexojs:master.

coveralls avatar Aug 16 '20 09:08 coveralls

but resolving '../' is not supported

path.resolve() is work?

jiangtj avatar Aug 17 '20 01:08 jiangtj

path.resolve() is work?

I mean this joinPath() doesn't support resolving path yet, perhaps in future if there is a demand, currently it's out of scope.

for now, need to joinPath(resolve(from, to), pathtwo).


fixed unit test, ready for review.

curbengh avatar Aug 17 '20 08:08 curbengh

@curbengh

Recently I have found a package on npm: https://npm.im/url-join

Have a look?

SukkaW avatar Sep 07 '20 08:09 SukkaW