github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/map_/filter/api.go (about) 1 // Package filter provides helpers for filtering keys or values of a map 2 package filter 3 4 import "github.com/m4gshm/gollections/map_" 5 6 // Keys an alias of the map_.FilterKeys 7 func Keys[M ~map[K]V, K comparable, V any](m M, filter func(K) bool) map[K]V { 8 return map_.FilterKeys(m, filter) 9 } 10 11 // Values an alias of the map_.FilterValues 12 func Values[M ~map[K]V, K comparable, V any](m M, filter func(V) bool) map[K]V { 13 return map_.FilterValues(m, filter) 14 }