Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/omit-by/docs/types/index.d"

Index

Type aliases

Functions

Type aliases

Binary

Binary: (key: any, value: any) => boolean

Checks whether an iterated property passes a test.

param

iteration key

param

property value

returns

boolean indicating whether an iterated property passes a test

Type declaration

    • (key: any, value: any): boolean
    • Parameters

      • key: any
      • value: any

      Returns boolean

Nullary

Nullary: () => boolean

Checks whether an iterated property passes a test.

returns

boolean indicating whether an iterated property passes a test

Type declaration

    • (): boolean
    • Returns boolean

Predicate

Predicate: Nullary | Unary | Binary

Checks whether an iterated value passes a test.

param

iteration key

param

property value

returns

boolean indicating whether an iterated property passes a test

Unary

Unary: (key: any) => boolean

Checks whether an iterated property passes a test.

param

iteration key

returns

boolean indicating whether an iterated property passes a test

Type declaration

    • (key: any): boolean
    • Parameters

      • key: any

      Returns boolean

Functions

Export assignment omitBy

  • omitBy(obj: any, predicate: Predicate): Object
  • Returns a partial object copy excluding properties for which a predicate returns a truthy value.

    Notes

    • The function returns a shallow copy.
    • The function only copies own properties. Hence, the function never copies inherited properties.

    Parameters

    • obj: any

      source object

    • predicate: Predicate

      predicate function

    Returns Object

    new object

    Example

    function predicate( key, value ) {
        return ( value > 1 );
    }
    
    var obj1 = {
        'a': 1,
        'b': 2
    };
    
    var obj2 = omitBy( obj1, predicate );
    // returns { 'a': 1 }