Function conforms

  • Creates a function that invokes the predicate properties of source with the corresponding property values of a given object, returning true if all predicates return truthy, else false.

    Note: The created function is equivalent to conformsTo with source partially applied.

    Parameters

    • source: object

      The object of property predicates to conform to.

    Returns ((object: object) => boolean)

    Returns the new spec function.

      • (object): boolean
      • Parameters

        • object: object

        Returns boolean

    4.0.0

    const objects = [
    { 'a': 2, 'b': 1 },
    { 'a': 1, 'b': 2 }
    ]

    filter(objects, conforms({ 'b': function(n) { return n > 1 } }))
    // => [{ 'a': 1, 'b': 2 }]