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 !!!
- Host: GitHub
- URL: https://github.com/romkor/ramda-validator
- Owner: romkor
- License: mit
- Created: 2015-11-30T11:27:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T12:41:39.000Z (over 10 years ago)
- Last Synced: 2025-02-14T02:53:01.709Z (over 1 year ago)
- Topics: ramda, ramdajs, validation
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ramda-validator
[](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