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

Truncates a string up to a specified length.

Determine if the string's length is greater than num. Return the string truncated to the desired length, with '...' appended to the end or the original string.

type

(
str: string,
num?: number,
ellipsisStr?,
) => unknown