This package currently add new function to handle deep object and remove it
You can remove unnecessary payload without stress.
// * Lets say you have payload like this
import { removeObjectDynamic, removeObjectDeepDynamic } from 'remove-object-dynamic'
const payload = {
name: null,
age: null,
works: undefiend,
status: 'Work'
}
const payload2 = {
age: null,
works: undefiend,
status: 'Work',
fullName: {
first: 'Zulfan',
last: ''
}
}
console.log(removeObjectDynamic(payload))
console.log(removeObjectDeepDynamic(payload2))
// * Result
// First Result
{ status: 'Work' }
// Second result
{ status: 'Work', fullName: { first: 'Zulfan' } }