We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Something like
export function clear(dirtyObject) { const cleanObject = {}; Object.keys(dirtyObject).forEach(key => { const value = dirtyObject[key]; if (value === null || value.length === 0) { return; } cleanObject[key] = value; }); return cleanObject; }
The text was updated successfully, but these errors were encountered:
I would rather use .reduce
and return a new object instead of mutating
Sorry, something went wrong.
Nice, I think that it's even better! 😄
Why not https://www.npmjs.com/package/lodash.omitby and https://www.npmjs.com/package/lodash.isnull?
omitBy(obj, isNull)
No branches or pull requests
Something like
The text was updated successfully, but these errors were encountered: