Skip to main content
Module

x/ts_morph/mod.ts>Project#getSourceFile

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
method Project.prototype.getSourceFile
import { Project } from "https://deno.land/x/ts_morph@15.1.0/mod.ts";

Gets a source file by a file name or file path. Returns undefined if none exists.

Parameters

fileNameOrPath: string
  • File name or path that the path could end with or equal.

Returns

SourceFile | undefined

Gets a source file by a search function. Returns undefined if none exists.

Parameters

searchFunction: (file: SourceFile) => boolean
  • Search function.

Returns

SourceFile | undefined