Skip to content

Conversation

Diaphteiros
Copy link
Contributor

What this PR does / why we need it:
Adds utility functions for checking if a map is a superset of another map.

Which issue(s) this PR fixes:
None

Special notes for your reviewer:

Release note:

The `pkg/collections/maps` package now has a `ContainsKeysAndValues` function that checks whether a given map is a superset of another map, meaning all keys of the second map also exist in the first one and they have the same values. There is also a `ContainsKeysAndValuesFunc` function that allows to pass in a custom equality function for the value comparison and a `ContainsKeys` function that checks only for keys and ignores values.

@Diaphteiros Diaphteiros merged commit 6d91ed9 into main Jul 30, 2025
7 checks passed
@Diaphteiros Diaphteiros deleted the map-contain branch July 30, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants