# Function assertMap

Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test.

#### Example

    var data = { foo: 1, bar: 2 };

    let keys = [ 'foo', 'bar' ]
    let values = keys.map(assertMap(key => data[key], "Key not found"));
    // values is [1, 2]

    let keys = [ 'foo', 'bar', 'baz' ]
    let values = keys.map(assertMap(key => data[key], "Key not found"));
    // throws Error("Key not found")

- assertMap(predicateOrMap, errMsg?): ((obj: any) => any)

- #### Parameters

  - predicateOrMap: any
  - errMsg: string = "assert failure"

  #### Returns ((obj: any) => any)

  - - (obj): any

    - #### Parameters

      - obj: any

      #### Returns any

  - Defined in shared/common.js:366