Ramda’s R.pathSatisfies() answers a nested validation question: does the value at this path pass my predicate? You pass a predicate, a path array, then the object. Ramda reads the nested leftover with R.path, then calls your predicate. You get true or false. Native code would manually index each segment. R.pathSatisfies is a function, arity 3, automatically curried, so R.pathSatisfies(R.gt(0), ['score']) is already a function of one object.
The official sample is the whole idea. R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}) is true because 2 > 0. R.pathSatisfies(R.is(Object), [], {x: {y: 2}}) is true because an empty path tests the whole object. Need to read the value without a test? That is R.path. Need one top-level key? That is propSatisfies. Need strict equality? That is pathEq. Previous Logic helper is R.or. Next is R.propSatisfies.
Syntax
Call R.pathSatisfies. Start with this line.
Ramda
R.pathSatisfies(pred, path, obj)
Call
What it does
R.pathSatisfies(pred, path, obj)
Primary signature.
R.pathSatisfies(...)
Call the logic helper.
Prefer import { pathSatisfies } from "ramda" when you want a named import.
Library declarations
Ramda
R.pathSatisfies(pred, path, obj)
Parameters
Parameter
Description
pred
Required. Function. Predicate run on the nested leftover from R.path. Should return true or false.
path
Required. Array of keys. Nested path such as ['x', 'y'] or ['items', 0]. An empty array tests the whole object.
obj
Required. Object. The record to query. Missing segments make R.path return undefined.
Return Value
Return Value
Description
Boolean
true when the predicate passes on the nested leftover. Otherwise false. The object is not mutated.
Ramda Examples
📚 Getting Started
The official Ramda predicate samples, then cousins propSatisfies, path, and pathEq.
Example 1 — Official Predicate Samples
The docs show a nested positive check and an empty-path object test. Both return booleans from your predicate.
propSatisfies is the one-key version. path returns the nested leftover without a boolean test. pathEq is equality instead of a custom predicate. Previous Logic helper is R.or.
📈 Practical Patterns
Missing paths and undefined leftovers, then filter with curry, then array indexes vs pathEq.
Example 3 — Missing Path and undefined to Predicate
When a segment is missing, R.path returns undefined. Your predicate still runs and decides the boolean.
Because pathSatisfies is arity 3, filling predicate and path leaves a function of one object. R.filter(isAdult, rows) keeps rows whose nested age passes R.gte(18).
Example 5 — Array Path Indexes vs pathEq
Paths can include numeric indexes. pathSatisfies runs your predicate on the nested leftover; pathEq checks one fixed value.
Index 1 in ['items', 1] reads the second array element. pathEq is strict equality; pathSatisfies(R.gt(2), ...) runs any predicate.
Compatibility
Browser Support
R.pathSatisfies() is ordinary JavaScript once Ramda is loaded. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Ramda 0.19.0+ · Any JS runtime
Ramda.js R.pathSatisfies()
Load Ramda 0.19.0 or later via CDN or npm, then call R.pathSatisfies with a predicate, path, and object. No extra browser API is required.
100%With Ramda 0.19.0+
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
R.pathSatisfies()Universal
Bottom line: Safe in any project that includes Ramda 0.19.0 or later. Use a CDN build such as ramda.min.js in the browser or install ramda from npm for Node. These labs use [email protected].
Frequently Asked Questions
R.pathSatisfies(pred, path, obj) reads the nested value at path with R.path, then returns pred(value). true when the predicate passes, false otherwise. Added in v0.19.0. Type: (a → Boolean) → [Idx] → {a} → Boolean. Arity 3, curried.
R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}) is true. R.pathSatisfies(R.is(Object), [], {x: {y: 2}}) is true because an empty path tests the whole object.
propSatisfies tests one top-level key. path reads a nested value without a test. pathEq checks strict equality to a fixed value. pathSatisfies runs any predicate on the nested leftover.
R.path returns undefined for a missing segment. The predicate still runs. For example, (y => y > 0)(undefined) is false. You get false, not a throw.
pathSatisfies names the pattern, is curried for filter and pipe, and handles the path read in one helper. R.filter(R.pathSatisfies(pred, path)) keeps rows that pass.
No. R.pathSatisfies is a stable Ramda logic helper from v0.19.0. It is not deprecated, experimental, or non-standard.