Skip to main content
Module

x/ts_morph/mod.ts>Node#replaceWithText

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

Replaces the text of the current node with new text.

This will forget the current node and return a new node that can be asserted or type guarded to the correct type.

Parameters

textOrWriterFunction: string | WriterFunction
  • Text or writer function to replace with.

Returns

The new node.