Skip to content

Commit 0f2d07e

Browse files
committed
Using path.posix instead of string manipulation
1 parent db8a85f commit 0f2d07e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

preload.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ const Serial = {
7474
return board.exit_raw_repl()
7575
},
7676
getNavigationPath: (navigation, target) => {
77-
return [navigation, target].filter(p => p).join('/')
77+
return path.posix.join(navigation, target)
7878
},
7979
getFullPath: (root, navigation, file) => {
80-
return root + [navigation, file].filter(p => p).join('/')
80+
return path.posix.join('/', navigation, file)
8181
},
8282
getParentPath: (filePath) => {
83-
return filePath.split('/').slice(0, -1).join('/')
83+
return path.posix.dirname(navigation)
8484
}
8585
}
8686

0 commit comments

Comments
 (0)