Function createVarRenamer

  • Creates callback that returns a unique name for a variable.

    Returns

    The unique variable name.

    See

    encodeAlphaName

    Parameters

    • Optional varNameMapping: Iterable<[Var, string]> | [Var, string][]

      The iterable list of var-name pairs.

    • encodeName: ((index: number, forbiddenNames?: string[]) => string | undefined) = encodeAlphaName

      Encodes the variable index as a valid name.

        • (index: number, forbiddenNames?: string[]): string | undefined
        • Encodes index as a valid lowercase alpha variable name.

          Returns

          A variable name or undefined if an index corresponds to a forbidden name.

          Parameters

          • index: number

            The variable index to encode.

          • forbiddenNames: string[] = reservedKeywords

            The array of names that cannot be returned.

          Returns string | undefined

    Returns VarRenamer

Generated using TypeDoc