Loading homepage
Implement deepOmit(value, keys) to produce a copy of a nested structure with selected object properties removed wherever they occur.
Traverse plain objects and arrays. Removing a key from an object must not remove an array position with the same string name.
Input: deepOmit({ id: 1, secret: "x", child: { secret: "y", title: "A" } }, ["secret"]); Output: { id: 1, child: { title: "A" } }
Input: deepOmit([{ id: 1, hidden: true }, { id: 2 }], ["hidden", "0"]); Output: [{ id: 1 }, { id: 2 }]
Input: deepOmit({ a: { b: 2 } }, []); Output: { a: { b: 2 } } // Both plain objects are new copies.
The JavaScript and TypeScript variants use the same API and behavior.