Skip to content

Instantly share code, notes, and snippets.

Created March 9, 2016 16:44
What would you like to do?
// Depends on lodash.cloneDeepWith
// This example assumes excludeKeys is an array
function omitDeep(collection, excludeKeys) {
function omitFn(value) {
if (value && typeof value === 'object') {
excludeKeys.forEach((key) => {
delete value[key];
return _.cloneDeepWith(collection, omitFn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment