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

x/indent_and_wrap/private/indent.ts>getTextRect

Finds and replaces common indent, hard-wraps text, generates text tables and table-based complex text layouts. Can work on text that contains terminal escape sequences.
Go to Latest
function getTextRect
import { getTextRect } from "https://deno.land/x/indent_and_wrap@v0.0.15/private/indent.ts";

This function works the same as indentAndWrap(), but it doesn't return resulting text, but it returns number of lines and columns the result occupies. It only counts columns on non-blank lines.

Parameters

text: string
optional
options: GetTextRectOptions
optional
knownCommonIndent: string