View Source euneus_formatter (euneus v1.2.1)
JSON formatter.
Copyright 2023 William Fank Thomé
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.Summary
Functions
Format JSON.
Format JSON.
See also: euneus_formatter:parse_opts/1.
Remove extra spaces and line feeds from JSON.
See also: euneus_formatter:format_parsed/2.
Format JSON for printing.
See also: euneus_formatter:format_parsed/2.
Types
-type input() :: binary() | iolist().
-type options() ::
#{spaces => binary() | non_neg_integer(),
indent => binary() | non_neg_integer(),
crlf => binary() | cr | lf | crlf}.
-type parsed_options() :: #opts{}.
-type result() :: iolist().
Functions
-spec format_parsed(input(), parsed_options()) -> result().
See also: euneus_formatter:parse_opts/1.
See also: euneus_formatter:format_parsed/2.
-spec parse_opts(options()) -> parsed_options().
Parses euneus_formatter:options()
to euneus_formatter:parsed_options()
.
See also: euneus_formatter:format_parsed/2.