Skip to main content

conformsTo

_.conformsTo(source, object) # Ⓢ [Ⓣ][1] Ⓝ

Checks if object conforms to source by invoking the predicate



properties of source with the corresponding property values of object.





Note: This method is equivalent to _.conforms when source is



partially applied.

Since​

4.14.0

Arguments​

  1. source (Object): The object of property predicates to conform to.
  2. object (Object): The object to inspect.

Returns​

(boolean): Returns true if object conforms, else false.

Example​

var object = { 'a': 1, 'b': 2 };

_.conformsTo({ 'b': function(n) { return n > 1; } }, object);
// => true

_.conformsTo({ 'b': function(n) { return n > 2; } }, object);
// => false