@samber: I sometimes forget to update this file. Ping me on Twitter or open an issue in case of error. We need to keep a clear changelog for easier lib upgrade.
Improvement:
- Async and AsyncX: now returns
<-chan T
instead ofchan T
Adding:
- lo.ValueOr
- lo.DebounceBy
- lo.EmptyableToPtr
Improvement:
- Substring: add support for non-english chars
Fix:
- Async: Fix goroutine leak
Adding:
- lo.PartialX
- lo.Transaction
Improvement:
- lo.Associate / lo.SliceToMap: faster memory allocation
Chore:
- Remove *_test.go files from releases, in order to cleanup dev dependencies
Adding:
- lo.AttemptWhile
- lo.AttemptWhileWithDelay
Adding:
- lo.RandomString
- lo.BufferWithTimeout (alias to lo.BatchWithTimeout)
- lo.Buffer (alias to lo.Batch)
Change:
- lo.Slice: avoid panic caused by out-of-bounds
Deprecation:
- lo.BatchWithTimeout
- lo.Batch
Improving:
- lo.Union: faster and can receive more than 2 lists
Adding:
- lo.FanIn (alias to lo.ChannelMerge)
- lo.FanOut
Deprecation:
- lo.ChannelMerge
Adding:
- lo.ChannelMerge
Improving:
- helpers with callbacks/predicates/iteratee now have named arguments, for easier autocompletion
Adding:
- lo.ChannelToSlice
- lo.CountValues
- lo.CountValuesBy
- lo.MapEntries
- lo.Sum
- lo.Interleave
- TupleX.Unpack()
Adding:
- lo.SliceToChannel
- lo.Generator
- lo.Batch
- lo.BatchWithTimeout
Fix:
- lo.Try1: remove generic type
- lo.Validate: format error properly
Adding:
- lo.TernaryF
- lo.Validate
Adding:
- lo.ErrorAs
- lo.TryOr
- lo.TryOrX
Adding:
- lo.ChannelDispatcher with 6 dispatching strategies:
- lo.DispatchingStrategyRoundRobin
- lo.DispatchingStrategyRandom
- lo.DispatchingStrategyWeightedRandom
- lo.DispatchingStrategyFirst
- lo.DispatchingStrategyLeast
- lo.DispatchingStrategyMost
Bugfix:
- Removed comparable constraint for lo.FindKeyBy
Breaking:
- Change of MapToSlice prototype:
MapToSlice[K comparable, V any, R any](in map[K]V, iteratee func(V, K) R) []R
->MapToSlice[K comparable, V any, R any](in map[K]V, iteratee func(K, V) R) []R
Added:
- lo.ChunkString
- lo.SliceToMap (alias to lo.Associate)
Adding:
- lo.Associate
- lo.ReduceRight
- lo.FromPtrOr
- lo.MapToSlice
- lo.IsSorted
- lo.IsSortedByKey
Adding:
- lo.FindUniques
- lo.FindUniquesBy
- lo.FindDuplicates
- lo.FindDuplicatesBy
- lo.IsNotEmpty
Adding:
- lo.Without
- lo.WithoutEmpty
Adding:
- lo.FindKey
- lo.FindKeyBy
Adding:
- lo.Slice
- lo.FromPtr
- lo.IsEmpty
- lo.Compact
- lo.ToPairs: alias to lo.Entries
- lo.FromPairs: alias to lo.FromEntries
- lo.Partial
Change:
- lo.Must + lo.MustX: add context to panic message
Fix:
- lo.Nth: out of bound exception (#137)
Adding:
- lo.ToAnySlice
- lo.FromAnySlice
Adding:
- lo.Synchronize
- lo.SumBy
Change:
- Removed generic type definition for lo.Try0:
lo.Try0[T]()
->lo.Try0()
Adding:
- lo.RepeatBy
- lo.Subset
- lo.Replace
- lo.ReplaceAll
- lo.Substring
- lo.RuneLength
Adding:
- lo.SomeBy
- lo.EveryBy
- lo.None
- lo.NoneBy
Adding:
- lo.Unpack2 -> lo.Unpack3
- lo.Async0 -> lo.Async6
Adding:
- lo.AttemptWithDelay
Improvement:
- lo.Must: error or boolean value
Adding:
- lo.Coalesce
Adding:
- PickBy
- PickByKeys
- PickByValues
- OmitBy
- OmitByKeys
- OmitByValues
- Clamp
- MapKeys
- Invert
- IfF + ElseIfF + ElseF
- T0() + T1() + T2() + T3() + ...
Adding:
- Must
- Must{0-6}
- FindOrElse
- Async
- MinBy
- MaxBy
- Count
- CountBy
- FindIndexOf
- FindLastIndexOf
- FilterMap
Adding:
- Try
- Try{0-6}
- TryWitchValue
- TryCatch
- TryCatchWitchValue
- Debounce
- Reject
Adding:
- Range
- RangeFrom
- RangeWithSteps
Added
- Drop
- DropRight
- DropWhile
- DropRightWhile
Adding Union.
Adding ContainBy
Adding MapValues
Adding FlatMap
Fixed PartitionBy.
Adding Sample
Adding Samples
Adding Times
Adding Attempt
Adding Repeat
- adding tuple types (2->9)
- adding Zip + Unzip
- adding lo.PartitionBy + lop.PartitionBy
- adding lop.GroupBy
- fixing Nth
Last and Nth return errors
Adding lop.Map
and lop.ForEach
.
Adding i int
param to lo.Map()
, lo.Filter()
, lo.ForEach()
and lo.Reduce()
predicates.
Initial release
Supported helpers for slices:
- Filter
- Map
- Reduce
- ForEach
- Uniq
- UniqBy
- GroupBy
- Chunk
- Flatten
- Shuffle
- Reverse
- Fill
- ToMap
Supported helpers for maps:
- Keys
- Values
- Entries
- FromEntries
- Assign (maps merge)
Supported intersection helpers:
- Contains
- Every
- Some
- Intersect
- Difference
Supported search helpers:
- IndexOf
- LastIndexOf
- Find
- Min
- Max
- Last
- Nth
Other functional programming helpers:
- Ternary (1 line if/else statement)
- If / ElseIf / Else
- Switch / Case / Default
- ToPtr
- ToSlicePtr
Constraints:
- Clonable