Format a value as the token written after KEY=, so that dotenv's parse
and then get-dotenv's expander read it back exactly.
A $ the expander would act on (one that starts a reference, or follows a
\) is written as \$, so the value is literal: a reference can't be
written through this function. Forms of that text are tried in order and
the first that dotenv reads back unchanged is used:
with preferQuote (the line's current quote style): that quote, then the
other quotes (double, single, backtick), then bare;
without: bare, then double quotes, single quotes, backticks.
Line breaks inside a quoted value are written in fileEol.
Error when no form reads back unchanged (for example, a value that
needs quotes and contains every quote character). The message names the
key, never the value.
Format a value as the token written after
KEY=, so that dotenv'sparseand then get-dotenv's expander read it back exactly.A
$the expander would act on (one that starts a reference, or follows a\) is written as\$, so the value is literal: a reference can't be written through this function. Forms of that text are tried in order and the first that dotenv reads back unchanged is used:preferQuote(the line's current quote style): that quote, then the other quotes (double, single, backtick), then bare;Line breaks inside a quoted value are written in
fileEol.