node package manager


ramda-t npm version

Experiment: Primitive, JSDoc-assisted runtime type checking for Ramda

It reads JSDoc documentation from the project's Ramda source file and uses the functions' @param annotations to determine valid argument types in function application.


  • Throws a TypeError when passing values of incorrect type to Ramda functions


  1. npm install ramda-t in a project that has ramda installed.
  2. Require ramda-t instead of ramda.


var R = require('ramda-t');
var doubleAll =;
doubleAll('foo'); // oops 


  • Lens value types are documented as Lens, despite being type of Function
  • How to smoothly make ramda-t part of development process but drop for production use?
  • R.reject takes @param Object as second argument, and dispatches to filter, a method of a different name than the function itself.


  • Relies on JSDoc @param annotations to be correct. Some may not be. The generated ramda.json may be edited to correct types.
  •'s second argument is type of Array. Becomes an issue when is used to dispatch. Dispatched arguments are difficult to parse from JSDoc annotations because they're part of the description. Workaround: Check if value is dispatchable, i.e. has a method by the name of the function.

running ramda test suite with ramda-t

./scripts/ propEq.js

debug output

Set DEBUG environment variable to ramda-t.

DEBUG=ramda-t node index.js