Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
chain-able-deps / src / conditional / negate.ts
Size: Mime:
import { Predicate } from '../_typings'

/**
 * @name negate
 * @memberOf conditional
 * @since 5.0.0-beta.6
 * @see conditional/not
 * @param  {Function} predicate call this
 * @return {Function} call this to call predicate with arguments
 *
 * @example
 *    const T = x => true
 *    const F = negate(t)
 *    F(true)   //=> false
 *    F(false)  //=> true
 */
export default function negate(predicate: Predicate) {
  return function() {
    return !predicate.apply(this, arguments)
  }
}