Packages

Render wisp HTTP responses into a human-readable representation

Current section

Files

Jump to
wispie src wispie@internal@string_tree_util.erl
Raw

src/wispie@internal@string_tree_util.erl

-module(wispie@internal@string_tree_util).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/wispie/internal/string_tree_util.gleam").
-export([append_if_present/3]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(false).
-file("src/wispie/internal/string_tree_util.gleam", 3).
?DOC(false).
-spec append_if_present(gleam@string_tree:string_tree(), binary(), binary()) -> gleam@string_tree:string_tree().
append_if_present(Tree, Separator, Content) ->
case Content of
<<""/utf8>> ->
Tree;
_ ->
_pipe = Tree,
_pipe@1 = gleam@string_tree:append(_pipe, Separator),
gleam@string_tree:append(_pipe@1, Content)
end.