Apply edits to a parsed dotenv document while preserving formatting.
Requirements addressed:
Mode: merge vs sync.
Duplicate key strategy: all/first/last.
undefined behavior: skip (default).
null behavior: delete (default).
Values are written so dotenv reads them back exactly (formatDotenvValue): the line's quote
style is kept when it can hold the value; otherwise another quote style, or bare.
Apply edits to a parsed dotenv document while preserving formatting.
Requirements addressed: