MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / filePathJoin

Function filePathJoin

packages/@contentlayer/utils/src/file-paths.ts:80–90  ·  view source on GitHub ↗
(...paths: string[])

Source from the content-addressed store, hash-verified

78export function filePathJoin(...paths: RelativePosixFilePath[]): RelativePosixFilePath
79export function filePathJoin(...paths: [AbsolutePosixFilePath, ...string[]]): AbsolutePosixFilePath
80export function filePathJoin(...paths: string[]): RelativePosixFilePath | AbsolutePosixFilePath {
81 if (paths.length > 0 && path.isAbsolute(paths[0]!)) {
82 if (paths.slice(1).some(path.isAbsolute)) {
83 throw new Error(`All path segments except the first are expected to be relative, got ${paths}`)
84 }
85
86 return unknownToAbsolutePosixFilePath(path.join(...paths))
87 }
88
89 return unknownToRelativePosixFilePath(path.join(...paths))
90}
91
92export function dirname(path_: RelativePosixFilePath): RelativePosixFilePath
93export function dirname(path_: AbsolutePosixFilePath): AbsolutePosixFilePath

Callers 8

validateFieldDataFunction · 0.90
getDirPathFunction · 0.90
_ArtifactsDir.tsFile · 0.90
successCallbackFunction · 0.90
withPrefixFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…