Skip to content

Instantly share code, notes, and snippets.

@HenrikJoreteg
Last active August 9, 2018 15:44
Show Gist options
  • Save HenrikJoreteg/93479aa901b871d63287b853ea6b0e2d to your computer and use it in GitHub Desktop.
Save HenrikJoreteg/93479aa901b871d63287b853ea6b0e2d to your computer and use it in GitHub Desktop.
lodash omit() in ~120 bytes lines instead of 2.5k
// compare to https://bundlephobia.com/result?p=lodash.omit@4.5.0
export default (obj, keys = []) => {
const copy = Object.assign({}, obj)
keys.forEach(key => {
delete copy[key]
})
return copy
}
@HenrikJoreteg
Copy link
Author

screen shot 2018-08-09 at 8 44 01 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment