Skip to main content
variable indentString
import { indentString } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Indents each line in the provided string.

Use String.replace and a regular expression to add the character specified by indent count times at the start of each line. Omit the third parameter, indent, to use a default indentation character of ' '.

type

(
str: string,
count: number,
indent?,
) => unknown