An object which contains the data you wish to filter
An object which contains the structure you wish to preserve
Optional
options: { Additional options which customize the filtration
Whether to keep deletion keys
Instead of keeping values from the source, instead draw values from the template
const source = {foo: {number: 1, name: "Tim", topping: "olives"}, bar: "baz"};
const template = {foo: {number: 0, name: "Mit", style: "bold"}, other: 72};
filterObject(source, template); // {foo: {number: 1, name: "Tim"}};
filterObject(source, template, {templateValues: true}); // {foo: {number: 0, name: "Mit"}};
Filter the contents of some source object using the structure of a template object. Only keys which exist in the template are preserved in the source object.