Packages

A Gleam library for sending emails using Plunk's API (https://useplunk.com), supports Erlang and JavaScript targets.

Current section

Files

Jump to
plunk src plunk@internal@utils.erl
Raw

src/plunk@internal@utils.erl

-module(plunk@internal@utils).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([omit_if_none/4]).
-file("/home/runner/work/plunk.gleam/plunk.gleam/src/plunk/internal/utils.gleam", 4).
-spec omit_if_none(
list({binary(), gleam@json:json()}),
binary(),
gleam@option:option(JJE),
fun((JJE) -> gleam@json:json())
) -> list({binary(), gleam@json:json()}).
omit_if_none(Fields, Key, Optional_value, Target) ->
case Optional_value of
{some, Value} ->
[{Key, Target(Value)} | Fields];
none ->
Fields
end.