SPeCS Packages Documentation
    Preparing search index...

    Converts a switch statement into either consecutive statements or if statements

    • If the switch has only one clause and a default case, it is converted to consecutive statements
    • Otherwise, it is converted to if statements
    Index

    Constructors

    Methods

    • Converts a switch statement to consecutive statements or if statements

      Parameters

      • switchStmt: Switch

        The switch statement to convert

      Returns Statement | undefined

      The converted statements or undefined if no statements remain

    • Converts a switch with only one clause and a default case into consecutive statements

      Parameters

      • switchStmt: Switch

        The switch statement to convert

      Returns Statement | undefined

      The first statement or undefined if no statements remain

    • Converts a switch statement into a series of if statements

      Parameters

      • switchStmt: Switch

        The switch statement to convert

      Returns If

      The first if statement created