Function isStringLiteralType

  • Test if a type is a StringLiteralType.

    Parameters

    • type: Type

    Returns type is StringLiteralType

    Example

    declare const type: ts.Type;

    if (isStringLiteralType(type)) {
    // ...
    }