about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger2024-07-26 01:16:49 +0200
committerSilvan Mosberger2024-07-26 01:16:49 +0200
commit60027e7836d9b8041f6a610fdcdd84973e7bf8c0 (patch)
tree095a436664b148eaf975eaf48816b7185d888a6c /lib
parent91a3ba906496b71d49aa1af46ab57cef5124eb9d (diff)
lib.trimWith: Minor doc improvements
Diffstat (limited to 'lib')
-rw-r--r--lib/strings.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/strings.nix b/lib/strings.nix
index 18ef707750bb..49c625e232c0 100644
--- a/lib/strings.nix
+++ b/lib/strings.nix
@@ -176,11 +176,12 @@ rec {
 
   /*
     Remove leading and/or trailing whitespace from a string.
+    To remove both leading and trailing whitespace, you can also use [`trim`](#function-library-lib.strings.trim)
 
     Whitespace is defined as any of the following characters:
       " ", "\t" "\r" "\n"
 
-    Type: trimWith :: Attrs -> string -> string
+    Type: trimWith :: { start ? false, end ? false } -> string -> string
 
     Example:
       trimWith { start = true; } "   hello, world!   "}
@@ -190,9 +191,9 @@ rec {
   */
   trimWith =
     {
-      # Trim leading whitespace
+      # Trim leading whitespace (`false` by default)
       start ? false,
-      # Trim trailing whitespace
+      # Trim trailing whitespace (`false` by default)
       end ? false,
     }:
     s: