Skip to content

Commit 6a3b0eb

Browse files
refactor code
1 parent 253427b commit 6a3b0eb

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,9 @@ get(transform(arguments[2]));
4343
function transform(filepath) {
4444
var link = url.parse(filepath);
4545
if (link.protocol) {
46-
if (link.pathname.charAt(0) == '/') {
47-
return link.protocol + "//" + link.host + link.pathname.slice(1);
48-
} else {
49-
return link.protocol + "//" + link.host + link.pathname;
50-
}
46+
return link.protocol + "//" + link.host + link.pathname;
5147
} else {
52-
if (link.pathname.charAt(0) == '/') {
53-
return "http://" + link.pathname.slice(1);
54-
} else {
55-
return "http://" + link.pathname;
56-
}
48+
return "http://" + link.pathname;
5749
}
5850
}
5951

0 commit comments

Comments
 (0)