Ramda.js R.propSatisfies() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Logic

Definition

Ramda’s R.propSatisfies() answers a top-level validation question: does this property pass my predicate? You pass a predicate, a property name string, then the object. Ramda reads the value with R.prop, then calls your predicate. You get true or false. Native code would manually read obj[name] and test it. R.propSatisfies is a function, arity 3, automatically curried, so R.propSatisfies(R.gt(0), 'score') is already a function of one object.

The official sample is the whole idea. R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}) is true because 1 > 0. Need to read the value without a test? That is R.prop. Need a nested field? That is pathSatisfies. Need strict equality? That is propEq. Need multiple properties at once? That is R.where. Previous Logic helper is R.pathSatisfies. Next is R.unless.

Syntax

Call R.propSatisfies. Start with this line.

Ramda
R.propSatisfies(pred, name, obj)
CallWhat it does
R.propSatisfies(pred, name, obj)Primary signature.
R.propSatisfies(...)Call the logic helper.

Prefer import { propSatisfies } from "ramda" when you want a named import.

Library declarations
Ramda
R.propSatisfies(pred, name, obj)

Parameters

ParameterDescription
predRequired. Function. Predicate run on the property value from R.prop. Should return true or false.
nameRequired. String. Top-level property name such as 'name', 'age', or 'score'.
objRequired. Object. The record to query. Missing keys make R.prop return undefined.

Return Value

Return ValueDescription
Booleantrue when the predicate passes on the property value. Otherwise false. The object is not mutated.

Ramda Examples

📚 Getting Started

The official Ramda predicate sample, then cousins pathSatisfies, propEq, propIs, and prop.

Example 1 — Official Predicate Samples

The docs show a top-level positive check plus false and missing-key cases. All return booleans from your predicate.

Ramda
R.propSatisfies(x => x > 0, 'x', { x: 1, y: 2 });
//=> true

R.propSatisfies(x => x > 0, 'x', { x: -1, y: 2 });
//=> false

R.propSatisfies(x => x > 0, 'z', { x: 1, y: 2 });
//=> false

R.propSatisfies(R.is(Number), 'x', { x: 1, y: 2 });
//=> true
Try It Yourself

How It Works

That is the docs sample from ramdajs.com. The source is pred(prop(name, obj)). A missing key passes undefined to the predicate.

Example 2 — vs pathSatisfies, propEq, propIs, and prop

propSatisfies tests with any predicate. pathSatisfies is nested. propEq is equality. propIs is type. prop reads.

Ramda
const row = { name: 'Ada', age: 30, score: 95 };

R.propSatisfies(R.is(String), 'name', row);
//=> true

R.pathSatisfies(R.is(String), ['name'], row);
//=> true

R.propEq('Ada', 'name', row);
//=> true

R.propIs(String, 'name', row);
//=> true

R.prop('age', row);
//=> 30
Try It Yourself

How It Works

pathSatisfies with ['name'] matches one top-level key here, but use it for nested paths. prop returns the value without a boolean test. Previous Logic helper is R.pathSatisfies.

📈 Practical Patterns

Missing properties and undefined leftovers, then filter with curry, then prop and where for multiple keys.

Example 3 — Missing Property and undefined to Predicate

When a key is missing, R.prop returns undefined. Your predicate still runs and decides the boolean.

Ramda
const obj = { x: 2 };

R.propSatisfies(x => x > 0, 'x', obj);
//=> true

R.propSatisfies(x => x > 0, 'missing', obj);
//=> false

R.propSatisfies(R.is(Number), 'x', obj);
//=> true

R.propSatisfies(R.is(Number), 'missing', obj);
//=> false
Try It Yourself

How It Works

(x => x > 0)(undefined) is false. R.is(Number)(undefined) is also false. No throw — the predicate handles the missing value.

Example 4 — Filter Rows with String Name

Fill predicate and property name first. Pass each row to the partial in R.filter.

Ramda
const rows = [
  { name: 'Ada', role: 'admin' },
  { name: 42, role: 'guest' },
  { name: 'Cy', role: 'editor' }
];

const hasStringName = R.propSatisfies(R.is(String), 'name');

R.filter(hasStringName, rows);
//=> first and third rows

R.filter(R.propSatisfies(R.is(String), 'name'), rows).length;
//=> 2
Try It Yourself

How It Works

Because propSatisfies is arity 3, filling predicate and name leaves a function of one object. R.filter(hasStringName, rows) keeps rows whose name passes R.is(String).

Example 5 — vs prop and where

propSatisfies tests one key. prop reads the value. where checks multiple properties at once with a spec object.

Ramda
const user = { name: 'Ada', age: 30, active: true };

R.propSatisfies(R.gte(18), 'age', user);
//=> true

R.prop('name', user);
//=> 'Ada'

R.where({ age: R.gte(18), active: R.equals(true) }, user);
//=> true

R.where({ age: R.gte(18), name: R.is(String) }, user);
//=> true
Try It Yourself

How It Works

where is the multi-key cousin. Use propSatisfies for one property test; use where when every key in the spec must pass. Next Logic helper is R.unless.

Browser Support

R.propSatisfies() is ordinary JavaScript once Ramda is loaded. Logos use the shared browser-image-sprite.png sprite from this project.

✓ Ramda 0.16.0+ · Any JS runtime

Ramda.js R.propSatisfies()

Load Ramda 0.16.0 or later via CDN or npm, then call R.propSatisfies with a predicate, property name, and object. No extra browser API is required.

100% With Ramda 0.16.0+
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
R.propSatisfies() Universal

Bottom line: Safe in any project that includes Ramda 0.16.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.propSatisfies(pred, name, obj) reads the top-level property with R.prop, then returns pred(value). true when the predicate passes, false otherwise. Added in v0.16.0. Type: (a → Boolean) → String → {String: a} → Boolean. Arity 3, curried.
R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}) is true because 1 > 0. The predicate runs on the value at the named top-level key.
pathSatisfies tests a nested path. propEq checks strict equality to a fixed value. propIs checks a constructor type. prop reads the value without a test. propSatisfies runs any predicate on one top-level key.
R.prop returns undefined for a missing key. The predicate still runs. For example, (x => x > 0)(undefined) is false. You get false, not a throw.
propSatisfies names the pattern, is curried for filter and pipe, and handles the property read in one helper. R.filter(R.propSatisfies(pred, 'name')) keeps rows that pass.
No. R.propSatisfies is a stable Ramda logic helper from v0.16.0. It is not deprecated, experimental, or non-standard.

Continue to R.unless()

Learn how to transform a value only when a predicate misses with Ramda R.unless().

R.unless() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful