Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment omit

  • omit<T, K>(obj: T, keys: Array<K> | K): Omit<T, K>
  • omit<T>(obj: T, keys: Array<string> | string): Partial<T>
  • Returns a partial object copy excluding specified keys.

    Notes

    • The function returns a shallow copy.
    • The function ignores non-existent keys.
    • The function only copies own properties. Hence, the function never copies inherited properties.

    Type parameters

    • T: object

    • K: keyof T

    Parameters

    • obj: T

      source object

    • keys: Array<K> | K

      keys to exclude

    Returns Omit < T , K >

    new object

    Example

    var obj1 = {
        'a': 1,
        'b': 2
    };
    
    var obj2 = omit( obj1, 'b' );
    // returns { 'a': 1 }
  • Type parameters

    • T: object

    Parameters

    • obj: T
    • keys: Array<string> | string

    Returns Partial < T >