@de-formed/react-validations
Advanced tools
+2
-2
| { | ||
| "name": "@de-formed/react-validations", | ||
| "version": "3.0.0", | ||
| "version": "3.0.1", | ||
| "description": "Modular, Function-driven Validations", | ||
@@ -22,3 +22,3 @@ "main": "dist/index", | ||
| "dependencies": { | ||
| "@de-formed/base": "3.0.0" | ||
| "@de-formed/base": "^3.0.0" | ||
| }, | ||
@@ -25,0 +25,0 @@ "peerDependencies": { |
+25
-13
@@ -5,16 +5,21 @@ <p align="center"> | ||
| [](https://badge.fury.io/js/@de-formed%2Fbase) | ||
| [](https://snyk.io/test/github/prescottbreeden/de-formed) | ||
|  | ||
| [](https://codecov.io/gh/prescottbreeden/de-formed) | ||
|  | ||
| [](https://badge.fury.io/js/@de-formed%2Freact-validations) | ||
| [](https://snyk.io/test/github/prescottbreeden/de-formed-validations-react) | ||
|  | ||
| [](https://codecov.io/gh/prescottbreeden/de-formed-validations-react) | ||
|  | ||
| @De-Formed Validations offers a robust and unopinionated API to customize form and data validations. With only a handful of properties to learn, @de-formed maintains its own internal state with simple function calls so that you can design your architecture the way you want to. | ||
| ## What is De-Formed? | ||
| De-Formed is a library for designing modular, event-driven form and data validations. Bind the things you need; ignore the things you don't. De-Formed will take care of the rest so that you can design your architecture the way you want to. | ||
| ## Why Use De-Formed? | ||
| 1. Modular and Composable. | ||
| 2. Unopinionated and Customizable. | ||
| 3. Lightweight. | ||
| 4. Easy to use. | ||
| 1. **Modular** - decoupled from your form architecture. | ||
| 1. **Composable** - turn your validations and forms into Lego bricks. | ||
| 1. **Extendable** - add/modify the API as you see fit | ||
| 1. **Unopinionated** - customize your UX to the Moon 🚀 | ||
| 1. **Lightweight** - [compare it on bundlephobia](https://bundlephobia.com/package/@de-formed/react-validations) | ||
| 1. **Easy to Use** - its all functions | ||
| 1. **Easy to Test** - unit test your business logic | ||
@@ -61,3 +66,4 @@ ## Install | ||
| { | ||
| error: 'Must be Ross if fist name is Bob.', | ||
| error: ({ lastName }) => | ||
| `${lastName} must be Ross if fist name is Bob.`, | ||
| validation: ({ firstName, lastName }) => { | ||
@@ -72,4 +78,6 @@ return firstName === 'Bob' ? lastName === 'Ross' : true; | ||
| ### Step 2: Use the hook anywhere you need it. | ||
| ### Step 2: Use the hook anywhere. | ||
| Bind the things you need; ignore the things you don't. De-Formed will take care of the rest. | ||
| ```tsx | ||
@@ -124,5 +132,9 @@ // PersonForm.component.tsx | ||
| ## Getting Started | ||
| Guided [walkthrough](https://github.com/prescottbreeden/de-formed-validations-react/wiki/Getting-Started) of how to customize De-Formed to the moon 🚀 | ||
| ## Documentation | ||
| Check out the [documentation](https://github.com/prescottbreeden/de-formed-validations-react/wiki/Docs). | ||
| API [documentation](https://github.com/prescottbreeden/de-formed-validations-react/wiki/Docs). | ||
@@ -129,0 +141,0 @@ ## Examples |
+1
-1
@@ -31,3 +31,3 @@ import React from 'react'; | ||
| * A hook that can be used to generate an object containing functions and | ||
| * properties pertaining to the validation state provided. | ||
| * properties pertaining to the validation schema provided. | ||
| * @param validationSchema an object containing all properties to validate | ||
@@ -34,0 +34,0 @@ * @returns validationObject |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
37668
2.03%144
9.09%0
-100%+ Added
- Removed
Updated