resolves #117 fix order of statements in relativize helper to avoid dropping fragment
authorDan Allen <dan@opendevise.com>
Thu, 26 Mar 2020 09:14:03 +0000 (03:14 -0600)
committerDan Allen <dan@opendevise.com>
Thu, 26 Mar 2020 09:14:03 +0000 (03:14 -0600)
src/helpers/relativize.js

index c96a701..6fdfb45 100644 (file)
@@ -11,8 +11,8 @@ module.exports = (to, from, ctx) => {
   let hash = ''
   const hashIdx = to.indexOf('#')
   if (~hashIdx) {
-    to = to.substr(0, hashIdx)
     hash = to.substr(hashIdx)
+    to = to.substr(0, hashIdx)
   }
   return to === from
     ? hash || (isDir(to) ? './' : path.basename(to))