projects
/
eg-antora.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aeb0d0c
)
update relativize to return to if from is falsy
author
Dan Allen
<dan@opendevise.com>
Tue, 27 Mar 2018 06:59:59 +0000
(
00:59
-0600)
committer
Dan Allen
<dan@opendevise.com>
Tue, 27 Mar 2018 06:59:59 +0000
(
00:59
-0600)
src/helpers/relativize.js
patch
|
blob
|
history
diff --git
a/src/helpers/relativize.js
b/src/helpers/relativize.js
index
f9788c0
..
090ee24
100644
(file)
--- a/
src/helpers/relativize.js
+++ b/
src/helpers/relativize.js
@@
-4,7
+4,7
@@
const { posix: path } = require('path')
// TODO memoize
module.exports = (from, to) => {
- if (to.charAt() === '#') return to
+ if (
!from ||
to.charAt() === '#') return to
let hash = ''
const hashIdx = to.indexOf('#')
if (~hashIdx) {