Skip to main content
Module

x/ts_morph/bootstrap/mod.ts>Project#getSourceFileOrThrow

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

Gets a source file by a file name or file path. Throws an error if it doesn't exist.

Parameters

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

Returns

ts.SourceFile

Gets a source file by a search function. Throws an error if it doesn't exist.

Parameters

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

Returns

ts.SourceFile