Use path.posix.join() instead

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala committed 2020-12-02 12:01:33 +02:00
1 parent 3e7315a2c8
commit 0448bd541f
1 file changed
+1 -1
+1 -1
View File
@@ -44,7 +44,7 @@ export function getExtensionPageUrl<P extends object>({ extensionId, pageId = ""
const extensionBaseUrl = compile(`/extension/:name`)({ const extensionBaseUrl = compile(`/extension/:name`)({
name: sanitizeExtensionName(extensionId), // compile only with extension-id first and define base path name: sanitizeExtensionName(extensionId), // compile only with extension-id first and define base path
}); });
const extPageRoutePath = path.join(extensionBaseUrl, pageId).replace(/\\/g, "/"); // path.join returns \ as separator on Windows and needs to be replaced with / const extPageRoutePath = path.posix.join(extensionBaseUrl, pageId);
if (params) { if (params) {
return compile(extPageRoutePath)(params); // might throw error when required params not passed return compile(extPageRoutePath)(params); // might throw error when required params not passed