Skip to main content
Module

x/ts_morph/common/mod.ts>StringUtils

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class StringUtils
import { StringUtils } from "https://deno.land/x/ts_morph@15.1.0/common/mod.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