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

x/deno2node/src/deps.deno.ts>CodeBlockWriter#unsafeInsert

Compile your Deno project to run on Node.js.
Go to Latest
method CodeBlockWriter.prototype.unsafeInsert
import { CodeBlockWriter } from "https://deno.land/x/deno2node@v1.10.0/src/deps.deno.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.