Function matches

  • Creates a function that performs a partial deep comparison between a given object and shape, returning true if the given object has equivalent property values, else false.

    Example

    let objects = [
    { a: 1, b: 2, c: 3 },
    { a: 4, b: 5, c: 6 }
    ]

    filter(objects, matches({ a: 4, c: 6 }))
    // [{ a: 4, b: 5, c: 6 }]

    Returns

    Parameters

    • shape: any

    Returns ((obj: any) => boolean)

      • (obj: any): boolean
      • Parameters

        • obj: any

        Returns boolean

Generated using TypeDoc