Current section
Files
Jump to
Current section
Files
src/common.erl
-module(common).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/common.gleam").
-export([decoder_name_of_t/1]).
-file("src/common.gleam", 4).
-spec decoder_name_of_t(binary()) -> binary().
decoder_name_of_t(Raw_name) ->
Snake_name = justin:snake_case(Raw_name),
Name = case gleam_stdlib:string_ends_with(Snake_name, <<"_json"/utf8>>) of
true ->
gleam@string:drop_end(Snake_name, 5);
false ->
Raw_name
end,
<<"get_decoder_"/utf8, Name/binary>>.