del-recursive
v1.2.0
Published
Delete recursive properties of object
Downloads
3
Maintainers
Readme
delRecursive
Delete recursive properties of object
Usage: delRecursive<T extends Object>(ob: T, toDelete: Array): T
import { delRecursive } from 'del-recursive'
const person = {
id: 1,
name: 'john',
metadata: {
personId: 1,
goodParson: true,
family: {
sister: 'lola'
}
}
}
const propsToDelete = ['id', 'personId', 'sister']
delRecursive(person, propsToDelete)
// Output: {
// name: 'john',
// metadata: {
// goodParson: true,
// family: { }
// }
// }
This module exported from utilizes project.