Checks if object conforms to source by invoking each predicate in source with the matching property value from object. Returns true only if every predicate passes. Part of Lodash Lang since 4.14.0 (stable — not deprecated). Note: equivalent to _.conforms(source) when that function is applied to object.
Pass the value you want to inspect or convert. Read the return type carefully before you use the result.
Syntax
Call _.conformsTo. Start with this line.
Lodash
_.conformsTo(object, source)
Call
What it does
_.conformsTo(object, source)
Primary signature.
_.conformsTo(value)
Check, compare, clone, or convert a value.
Prefer import conformsTo from "lodash/conformsTo" when you want a smaller bundle.
Library declarations
Lodash
_.conformsTo(object, source)
Parameters
Parameter
Description
object
Required. Object to inspect
source
Required. Object of property predicates to conform to
Return Value
Return Value
Description
*
true if object conforms, else false
Lodash Examples
Example 1 — Official: Predicate Passes or Fails
Run one predicate on a matching property.
Lodash
var object = { a: 1, b: 2 };
console.log(_.conformsTo(object, {
b: function (n) { return n > 1; }
})); // true
console.log(_.conformsTo(object, {
b: function (n) { return n > 2; }
})); // false
Source key. Only b is listed, so only object.b is tested.
Pass.2 > 1 → predicate truthy → true.
Fail.2 > 2 → predicate falsy → false.
Tip. Change the predicate, not the object shape, to express rules.
Example 2 — Multiple Predicates (All Must Pass)
Every source key must succeed — one failure fails the whole check.
Lodash
var user = { age: 21, active: true };
var ok = _.conformsTo(user, {
age: function (n) { return n >= 18; },
active: function (v) { return v === true; }
});
console.log(ok); // true
isMatch. Compares against a plain partial — b must equal 2.
conformsTo. Runs a function — any b > 1 is enough.
Pick. Exact values → isMatch; ranges and types → conformsTo.
Reuse. Need a filter predicate? Prefer _.conforms.
Compatibility
Browser & Runtime Support
_.conformsTo is a Lodash 4.x Lang helper (since 4.14.0). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native engines have no built-in predicate-map checker by this name.
✓ Stable · Lodash 4.14.0+
_.conformsTo()
Available in [email protected] full builds and the lodash/conformsTo modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.conformsToLodash 4.14.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import conformsTo from "lodash/conformsTo" for smaller builds. Not a native browser API — load Lodash first.
Frequently Asked Questions
_.conformsTo(object, source) checks whether object conforms to source by calling each predicate in source with the matching property value from object. Returns true only if every predicate passes.
No. It only reads values and runs predicates.
Lodash reads object[key], which is undefined when the key is missing. Your predicate must handle undefined if that case is possible.
isMatch compares against plain values or a partial object. conformsTo expects predicate functions in source for dynamic checks (greater-than, type tests, and so on).
conformsTo(object, source) is equivalent to applying _.conforms(source) to object — conforms returns a predicate function; conformsTo runs the check immediately.
Use import conformsTo from "lodash/conformsTo" or require("lodash/conformsTo") so bundlers can tree-shake unused Lodash code. Full build: import _ from "lodash" then _.conformsTo.