conforms

v4.17.15arrow_drop_down
v4.17.15
v4.17.11
STATUS
Passing
DOWNLOADS
134
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
Creates a function that invokes the predicate properties of `source` with
2 contributors
Install conforms as a package?
Copied
npm i @bit/lodash.lodash.conforms
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
conforms (
source:Object
) : Function

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.

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

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

The object of property predicates to conform to.

Returns
Function

Returns the new spec function.

Help and resources