Skip to main content
Module

x/indent_and_wrap/mod.ts>getTextRect

Finds and replaces common indent, and hard-wraps text. 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.8/mod.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