An open API service indexing awesome lists of open source software.

https://github.com/romkor/ramda-validator

!!! Abandoned !!!
https://github.com/romkor/ramda-validator

ramda ramdajs validation

Last synced: about 1 year ago
JSON representation

!!! Abandoned !!!

Awesome Lists containing this project

README

          

# ramda-validator
[![Build Status](https://travis-ci.org/romkor/ramda-validator.svg?branch=master)](https://travis-ci.org/romkor/ramda-validator)

## Usage

```js
var validateModel = RV.validator([
// Allow only following fields / add error to all fields that are not in list.
RV.permitAll(["id", "title", "description"]),
RV.requireAll(["id", "title"]),
RV.ifThen(RV.required("description"), RV.minLength("description", 5))
]);
var model = {
id: 42,
title: "Lorem ipsum dolor sit amet",
description: "",
categories: []
};
var validationResult = validateModel(model);
```

## Todo

* Add tests
* Refactoring
* Documentation
* Examples