Last active
August 9, 2018 15:44
-
-
Save HenrikJoreteg/93479aa901b871d63287b853ea6b0e2d to your computer and use it in GitHub Desktop.
lodash omit() in ~120 bytes lines instead of 2.5k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compare to https://bundlephobia.com/[email protected] | |
export default (obj, keys = []) => { | |
const copy = Object.assign({}, obj) | |
keys.forEach(key => { | |
delete copy[key] | |
}) | |
return copy | |
} |
Author
HenrikJoreteg
commented
Aug 9, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment