The conforms
function in lodash creates a function that checks if an object conforms to a given object shape. It returns a new function that takes an object as an argument, then returns a boolean value indicating whether the object conforms to the given shape or not.
Here's an example usage of conforms
:
index.tsx558 chars13 lines
In this example, the conforms
function is used to create a function conformsFunction
that checks if an object conforms to the shape shape
. The conformsFunction
is then used to filter the users
array, returning only the objects that match the shape.
gistlibby LogSnag