I wrote the function below to return all keys in an object that match a specific pattern. It seems really round-about because there\'s no filter function in lodash for objects,
Here's a succinct way to do this with lodash - reduce() and set() are your friends.
_.reduce(data, (result, value, key) => key.match(pattern) ? _.set(result, key, value) : result, {});