Reapply "lib/strings.concatLines: call concatStringsSep directly"

But also handle empty lists.

This effectively reapplies commit d7e6988c9b
which was reverted by commit 66f4e5d988.

Co-authored-by: Eman Resu <78693624+quatquatt@users.noreply.github.com>
This commit is contained in:
Matt Sturgeon
2026-04-28 20:11:20 +01:00
parent 9b481b0ed6
commit 986cb78f05

View File

@@ -337,7 +337,6 @@ rec {
/**
Concatenate a list of strings, adding a newline at the end of each one.
Defined as `concatMapStrings (s: s + "\n")`.
# Inputs
@@ -361,7 +360,7 @@ rec {
:::
*/
concatLines = concatMapStrings (s: s + "\n");
concatLines = lines: optionalString (lines != [ ]) (concatStringsSep "\n" lines + "\n");
/**
Given string `s`, replace every occurrence of the string `from` with the string `to`.