-module(yodel@internal@validator). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/yodel/internal/validator.gleam"). -export([validate_properties/1]). -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/yodel/internal/validator.gleam", 7). ?DOC(false). -spec validate_properties(yodel@internal@properties:properties()) -> {ok, yodel@internal@properties:properties()} | {error, yodel@errors:config_error()}. validate_properties(Props) -> case yodel@internal@properties:size(Props) of 0 -> _pipe = empty_config, _pipe@1 = {validation_error, _pipe}, {error, _pipe@1}; 1 -> case yodel@internal@properties:get(Props, <<""/utf8>>) of {ok, _} -> _pipe@2 = {invalid_config, <<"Invalid config: value without key"/utf8>>}, _pipe@3 = {validation_error, _pipe@2}, {error, _pipe@3}; {error, _} -> _pipe@4 = Props, {ok, _pipe@4} end; _ -> _pipe@5 = Props, {ok, _pipe@5} end.