MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / normalizeAndJoin

Function normalizeAndJoin

lib/container.js:1020–1032  ·  view source on GitHub ↗
(basePath, subPath)

Source from the content-addressed store, hash-verified

1018 return `./helper/${helperName}`
1019}
1020function normalizeAndJoin(basePath, subPath) {
1021 // Normalize and convert slashes to forward slashes in one step
1022 const normalizedBase = path.posix.normalize(basePath.replace(/\\/g, '/'))
1023 const normalizedSub = path.posix.normalize(subPath.replace(/\\/g, '/'))
1024
1025 // If subPath is absolute (starts with "/"), return it as the final path
1026 if (normalizedSub.startsWith('/')) {
1027 return normalizedSub
1028 }
1029
1030 // Join the paths using POSIX-style
1031 return path.posix.join(normalizedBase, normalizedSub)
1032}

Callers 1

loadGherkinStepsAsyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected