View Source euneus_formatter (euneus v2.4.0)

Summary

Functions

Formats a binary JSON.

Types

-type crlf() :: r | n | rn | none.
-type options() ::
          #{indent_type := tabs | spaces,
            indent_width := non_neg_integer(),
            spaced_values := boolean(),
            crlf := crlf()}.

Functions

-spec format(JSON, Options) -> iodata() when JSON :: binary(), Options :: options().

Formats a binary JSON.

Option details:

    Note

    There is no default for any option, all are required.
  • indent_type - Indent using tabs or spaces.

    • tabs - The indent char will be $\t.

    • spaces - The indent char will be $\s.

  • indent_width - The indent_type will be copied N times based on it.

  • spaced_values - Defines if keys and values of objects should be spaced by one $\s char.

  • crlf - Defines the Carriage Return/Line Feed.

    • r - The CRLF will be <<$\r>>.

    • n - The CRLF will be <<$\n>>.

    • rn - The CRLF will be <<$\r, $\n>>.

    • none - The CRLF will be <<>>.