File paths to inspect (absolute paths recommended).
OptionalbaseRoot: stringWhen provided, the result is the common ancestor of all
file directories AND this path. This prevents the result from being
deeper than baseRoot — use it to set a "minimum root" for the
computation. Has no effect on which files are included.
OptionalallowedRoot: stringWhen provided, files whose directory is not under this path are silently excluded from the computation. Acts as a security boundary — the result is always this path or a sub-directory of it (assuming at least one file is inside it).
The longest common parent directory, or "" if none exists.
Given a list of file paths, find the longest common parent directory.
Each element is treated as a file path — the last segment is the filename, not a directory. Empty strings are silently ignored.
/), returns"/"."".The function performs no I/O and does not call
path.resolve— it is a pure string operation. For best results, pass already-resolved absolute paths.