Merge pull request #330034 from tweag/trim-minor-improvements

lib.trimWith: Minor doc improvements
This commit is contained in:
Silvan Mosberger 2024-07-26 01:24:45 +02:00 committed by GitHub
commit 9ba898d5d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: