Skip to main content
Module

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

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

Updates the source file stored in the project at the specified path.

Parameters

filePath: string
  • File path of the source file.
sourceFileText: string
  • Text of the source file.
optional
options: { scriptKind?: ts.ScriptKind; }
  • Options for updating the source file.

Returns

ts.SourceFile

Updates the source file stored in the project. The fileName of the source file object is used to tell which file to update.

Parameters

newSourceFile: ts.SourceFile
  • The new source file.

Returns

ts.SourceFile