mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
606 B
606 B
name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | variantHelpers | similarHelpers | position | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| FromAnySeq | fromanyseq | it/type_manipulation.go#L11 | it | type |
|
|
|
244 |
FromAnySeq returns a sequence with all elements mapped to a type. Panics on type conversion failure.
collection := func(yield func(any) bool) {
yield(1)
yield(2)
yield("three") // This will cause panic
}
intSeq := it.FromAnySeq[int](collection)
// This will panic when trying to convert "three" to int