Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/dnt/lib/mod.deps.ts>CodeBlockWriter#unsafeInsert

Deno to npm package build tool.
Go to Latest
method CodeBlockWriter.prototype.unsafeInsert
import { CodeBlockWriter } from "https://deno.land/x/dnt@0.36.0/lib/mod.deps.ts";

Inserts text at the provided position.

This method is "unsafe" because it won't update the state of the writer unless inserting at the end position. It is biased towards being fast at inserting closer to the start or end, but slower to insert in the middle. Only use this if absolutely necessary.

Parameters

pos: number
  • Position to insert at.
text: string
  • Text to insert.