Options
All
  • Public
  • Public/Protected
  • All
Menu

Module function/complement

Index

References

Functions

References

Renames and re-exports complement

Functions

  • complement<F>(pred: F): (...args: Parameters<F>) => boolean
  • Takes a function f and returns a function g such that if called with the same arguments when f returns a "truthy" value, g returns false and when f returns a "falsy" value g returns true.

    example
     var isNotNil = complement(isNil);
    isNil(null); //=> true
    isNotNil(null); //=> false
    isNil(7); //=> false
    isNotNil(7); //=> true

    Type parameters

    • F: (...args: any[]) => any

    Parameters

    • pred: F

    Returns (...args: Parameters<F>) => boolean

      • (...args: Parameters<F>): boolean
      • Parameters

        • Rest ...args: Parameters<F>

        Returns boolean

Generated using TypeDoc