MCPcopy
hub / github.com/TypeStrong/ts-node / getBasePathForProjectLocalDependencyResolution

Function getBasePathForProjectLocalDependencyResolution

src/util.ts:147–158  ·  view source on GitHub ↗
(
  configFilePath: string | undefined,
  projectSearchDirOption: string | undefined,
  projectOption: string | undefined,
  cwdOption: string
)

Source from the content-addressed store, hash-verified

145 * @internal
146 */
147export function getBasePathForProjectLocalDependencyResolution(
148 configFilePath: string | undefined,
149 projectSearchDirOption: string | undefined,
150 projectOption: string | undefined,
151 cwdOption: string
152) {
153 if (configFilePath != null) return dirname(configFilePath);
154 return projectSearchDirOption ?? projectOption ?? cwdOption;
155 // TODO technically breaks if projectOption is path to a file, not a directory,
156 // and we attempt to resolve relative specifiers. By the time we resolve relative specifiers,
157 // should have configFilePath, so not reach this codepath.
158}
159
160/** @internal */
161export function once<Fn extends (...args: any[]) => any>(fn: Fn) {

Callers 1

findAndReadConfigFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…