./ct_report/coverage/mongoose_graphql_directive_helper.COVER.html

1 -module(mongoose_graphql_directive_helper).
2
3 -export([name/1, get_arg/2, op_name/1]).
4
5 op_name(undefined) ->
6 29443 <<"ROOT">>;
7 op_name(Name) ->
8
:-(
Name.
9
10 name({name, _, N}) ->
11 2624895 N;
12 name(N) when is_binary(N) ->
13
:-(
N.
14
15 get_arg(Name, Args) when is_binary(Name) ->
16 495 Path = binary:split(Name, <<".">>, [global]),
17 495 get_arg(Path, Args);
18 get_arg([], Value) ->
19 495 Value;
20 get_arg(_, undefined) ->
21
:-(
undefined;
22 get_arg(Path, List) when is_list(List) ->
23
:-(
[get_arg(Path, ArgsMap) || ArgsMap <- List];
24 get_arg([Name | Path], ArgsMap) ->
25 495 get_arg(Path, maps:get(Name, ArgsMap, undefined)).
Line Hits Source