File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -562,16 +562,16 @@ function getHelperModuleName(helperName, config) {
562562 // built-in helpers
563563 return `./helper/${ helperName } `
564564}
565-
566565function normalizeAndJoin ( basePath , subPath ) {
567- // Normalize the path (handles extra slashes and resolves `..`)
568- let normalizedBase = path . normalize ( basePath ) ;
569- let normalizedSub = path . normalize ( subPath ) ;
566+ // Normalize and convert slashes to forward slashes in one step
567+ const normalizedBase = path . posix . normalize ( basePath . replace ( / \\ / g , '/' ) )
568+ const normalizedSub = path . posix . normalize ( subPath . replace ( / \\ / g , '/' ) )
570569
571- // Replace backslashes with forward slashes
572- normalizedBase = normalizedBase . replace ( / \\ / g, '/' ) ;
573- normalizedSub = normalizedSub . replace ( / \\ / g, '/' ) ;
570+ // If subPath is absolute (starts with "/"), return it as the final path
571+ if ( normalizedSub . startsWith ( '/' ) ) {
572+ return normalizedSub
573+ }
574574
575575 // Join the paths using POSIX-style
576- return path . posix . join ( normalizedBase , normalizedSub ) ;
576+ return path . posix . join ( normalizedBase , normalizedSub )
577577}
You can’t perform that action at this time.
0 commit comments