MCPcopy Create free account
hub / github.com/observablehq/framework / getSourceFilePath

Method getSourceFilePath

src/loader.ts:265–271  ·  view source on GitHub ↗

* Returns the path to the backing file during preview, relative to the source * root, which is the source file for the associated data loader if the file * is generated by a loader.

(path: string)

Source from the content-addressed store, hash-verified

263 * is generated by a loader.
264 */
265 private getSourceFilePath(path: string): string {
266 if (!existsSync(join(this.root, path))) {
267 const loader = this.find(path);
268 if (loader) return loader.path;
269 }
270 return path;
271 }
272
273 /**
274 * Returns the path to the backing file during build, relative to the source

Callers 2

getSourceFileHashMethod · 0.95
getSourceInfoMethod · 0.95

Calls 2

findMethod · 0.95
existsSyncFunction · 0.85

Tested by

no test coverage detected