mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
583 B
583 B
name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | variantHelpers | similarHelpers | position | ||
|---|---|---|---|---|---|---|---|---|---|---|
| IsSortedBy | issortedby | it/seq.go#L720 | it | slice |
|
|
201 |
IsSortedBy checks if a sequence is sorted by transform.
collection := func(yield func(string) bool) {
yield("apple")
yield("banana")
yield("cherry")
}
sortedByLength := it.IsSortedBy(collection, func(s string) int {
return len(s)
})
// true (5, 6, 6 is sorted)