Removing keys in variable size, depth or shape objects
It's not uncommon for us to want to be able to delete an object property from an api response and when you have complete control over the api request/response cycle this may not be an issue. But, when you're consuming third-party services where the shape of the object may be of an unknown size or depth, or variable in shape, ensuring that sensitive data is not being leaked out is important.
This short snippet will show you how you can remove keys of any depth in an object by taking advantage of a nifty little helper library omit-deep-lodash (that only has lodash as a dependency).
Read MorePosted: 11 January 2021