1. omit-deep-lodash
Omit object key/values recursively with lodash as only dependency.
omit-deep-lodash
Package: omit-deep-lodash
Created by: odynvolk
Last modified: Wed, 22 Jun 2022 21:09:42 GMT
Version: 1.1.7
License: MIT
Downloads: 359,568
Repository: https://github.com/odynvolk/omit-deep-lodash

Install

npm install omit-deep-lodash
yarn add omit-deep-lodash

omit-deep-lodash

Omit object key/values recursively

Sometimes we need to omit things from an object recursively. omit-deep did this
in a great manner but hadn't been updated for quite some time and didn't really work with Arrays. omit-deep-lodash solves
this and uses only lodash as external dependency.

The code for this module uses new features in the Javascript language, but the code is transpiled by Babel to ES2015 so most
projects who needs it should be able to use it.

Note! All non-omitted properties that are objects lose their prototype chains and thus their true type. This implementation
is thus best used for simple JSON type objects like data objects and not typed object graphs where members have objects
with constructors.

Install

Install with npm

 $ npm i omit-deep-lodash --save

Usage

 const omitDeep = require("omit-deep-lodash");

omitDeep({a: "a", b: "b", c: {b: "b", d: {b: "b", f: "f"}}}, "b");
//=> {a: "a", c: {d: {f: "f"}}}

omitDeep({a: "a", b: "b", c: {b: "b", d: {b: "b", f: "f"}}}, "a", "b");
//=> {c: {d: {f: "f"}}}

Running tests

Install dev dependencies:

 $ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

License

Released under the MIT license.

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code