Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "common-keys"

Index

Functions

Const commonKeysMap

  • commonKeysMap<K>(a: Map<K, any>, b: Map<K, any>): K[]
  • Like commonKeysObj(), but for ES6 Maps.

    Type parameters

    • K

    Parameters

    • a: Map<K, any>
    • b: Map<K, any>

    Returns K[]

Const commonKeysObj

  • commonKeysObj(a: IObjectOf<any>, b: IObjectOf<any>): string[]
  • Returns array of keys present in both args, i.e. the set intersection of the given objects' key / property sets.

    commonKeys({ a: 1, b: 2 }, { c: 10, b: 20, a: 30 })
    // [ "a", "b" ]

    Parameters

    • a: IObjectOf<any>
    • b: IObjectOf<any>

    Returns string[]

Generated using TypeDoc