diff --git a/CHANGELOG.md b/CHANGELOG.md index 44e381e6..c1ca9682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ Adding: - lo.ValueOr - lo.DebounceBy +- lo.EmptyableToPtr + +Improvement: +- Substring: add support for non-english chars + +Fix: +- Async: Fix goroutine leak ## 1.37.0 (2022-12-15) diff --git a/slice.go b/slice.go index 20fbfac6..49c991f8 100644 --- a/slice.go +++ b/slice.go @@ -51,6 +51,8 @@ func FilterMap[T any, R any](collection []T, callback func(item T, index int) (R } // FlatMap manipulates a slice and transforms and flattens it to a slice of another type. +// The transform function can either return a slice or a `nil`, and in the `nil` case +// no value is added to the final slice. // Play: https://go.dev/play/p/YSoYmQTA8-U func FlatMap[T any, R any](collection []T, iteratee func(item T, index int) []R) []R { result := make([]R, 0, len(collection))