Module

x/ts_morph/common/ts_morph_common.d.ts>StringUtils

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Go to Latest
class StringUtils
import { StringUtils } from "https://dotland.deno.dev/x/ts_morph@21.0.0/common/ts_morph_common.d.ts";

Constructors

new
private
StringUtils()

Static Methods

endsWithNewLine(str: string | undefined): boolean
escapeChar(str: string, char: string): string

Escapes all the occurrences of the char in the string.

escapeForWithinString(str: string, quoteKind: "\"" | "'"): string
getLengthFromLineStartAtPos(str: string, pos: number): number
getLineEndFromPos(str: string, pos: number): number
getLineNumberAtPos(str: string, pos: number): number
getLineStartFromPos(str: string, pos: number): number
hasBom(text: string): boolean
indent(
str: string,
times: number,
options: { indentText: string; indentSizeInSpaces: number; isInStringAtPos: (pos: number) => boolean; },
): string
insertAtLastNonWhitespace(str: string, insertText: string): string
isNullOrEmpty(str: string | undefined): str is undefined
isNullOrWhitespace(str: string | undefined): str is undefined
isQuoted(text: string): boolean
isSpaces(text: string): boolean
isWhitespace(text: string | undefined): boolean
isWhitespaceCharCode(charCode: number | undefined): boolean
removeIndentation(str: string, opts: { isInStringAtPos: (pos: number) => boolean; indentSizeInSpaces: number; }): string
startsWithNewLine(str: string | undefined): boolean
stripBom(text: string): string
stripQuotes(text: string): string