• Converts various data types, such as objects, strings, exceptions, errors, or numbers, into a string representation. Since it offers a more comprehensive format, this function is preferred to JSON.stringify().

    Parameters

    • obj: any

      Any objects, strings, exceptions, errors, or number

    • Optional params: {
          decimal?: number;
          noBin?: boolean;
          recursion?: number;
          space?: string;
      }
      • Optional decimal?: number

        2, allows to choose the number of decimal to display in the string representation

      • Optional noBin?: boolean

        false, when set skip binary encoding and write inplace a bin-length information

      • Optional recursion?: number

        1, recursion depth to stringify recursively every object value until this depth, beware if a value refers to a already parsed value an infinite loop will occur

      • Optional space?: string

        '', allows to configure space in the string representation

    Returns string

    the final string representation

Generated using TypeDoc