formaze 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -32,7 +32,7 @@ const formSchema = makeFormSchema({
32
32
  password: { type: "password", minLength: { value: 8 } },
33
33
  });
34
34
 
35
- // create the form
35
+ // create the form component
36
36
  const Form = createFormValidator(formSchema);
37
37
 
38
38
  export function MyForm() {
@@ -103,9 +103,9 @@ const formSchema = makeFormSchema({
103
103
  },
104
104
  username: {
105
105
  type: "string",
106
- maxLength: {
107
- value: 12,
108
- message: "Username must be less than 12 characters",
106
+ regex: {
107
+ value: /^[a-z0-9]{3,}$/ /* only lowercase letters and numbers */,
108
+ message: "Username must contains lowercase letters and numbers",
109
109
  },
110
110
  customMessage: "Username must not be empty",
111
111
  },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Easily build forms with custom validation logic for React",
4
4
  "main": "dist/formaze.js",
5
5
  "types": "dist/index.d.ts",
6
- "version": "2.0.1",
6
+ "version": "2.0.3",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "react",