Function formatValue

  • Colorizes and formats a value based on its type.

    Example

    formatValue(1); // "1" (with colors)
    formatValue(BigInt(1)); // "1n" (with colors)
    formatValue([]); // "Array([])" (with colors)
    formatValue({}); // "Object({})" (with colors)

    Returns

    Colorized value as a string.

    Parameters

    • value: unknown

      Value to colorize.

    Returns string