substantial/updeep

View on GitHub
lib/omit.js

Summary

Maintainability
A
1 hr
Test Coverage
import _omit from 'lodash/omit'
import wrap from './wrap'
import size from './util/size'

function omit(predicate, collection) {
  const result = _omit(collection, predicate)

  const changed = collection == null || size(result) !== size(collection)
  if (changed) {
    return result
  } else {
    return collection
  }
}

export default wrap(omit)