@alanscodelog/utils
    Preparing search index...

    Function pretty

    • Pretty prints objects with tab indentation, or optionally all in a single line with a space between elements (e.g. for arrays) (see oneline option).

      Note that if your stringify function returns values with newlines these are preserved when using the oneline option.

      Parameters

      • obj: object
      • __namedParameters: { oneline?: boolean; stringify?: boolean | ((el: any) => undefined | string) } = {}
        • Optionaloneline?: boolean

          If true, does not use tabs, prints all in one line. Useful for prettifying arrays

        • Optionalstringify?: boolean | ((el: any) => undefined | string)

          The default is false, which will just leave the stringifying up to JSON.stringify (which will remove functions and symbols). If you need them you can pass true instead, in which case, it will use .toString() on them. Note this still does not stringify things like Sets "correctly".

          Otherwise, you can either pass a custom stringify function to completely customize the behavior.

          The function can return undefined to skip the value since undefined properties are not serialized by JSON.stringify. This function will be passed all the object's values. If a value is an object, it's passed all that value's values then the value itself (i.e. it's using walk with { after: true }).

          If it returns values with newlines note these are preserved when using the oneline option.

      Returns string