check_for_matching_key_values

Verify that keys in a collection of maps match.

github

Arguments

NameDescriptionType
xCollection of maps that may or may not contain one or more of keys.maps
keysCollection of strings that define which keys should be tested in x.strings

Output value

Boolean true or false if more than one of the keys were found in the maps and that all of the keys matched in each map for which there was a key/value pair.

Example

x = [first: 'sherlock', second: 'john']
y = [first: 'mary', second: 'john']

println(check_for_matching_key_values([x,y], ['first']))
// false

println(check_for_matching_key_values([x,y], ['second']))
// true