@cloudstrytech/validations 1.2.2 → 1.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudstrytech/validations",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "JavaScript utility functions for validation",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -15,42 +15,42 @@ function normalizeKey(key = "") {
15
15
  /* Mandatory fields mapped to REAL CSV headers */
16
16
  const MANDATORY_FIELDS = {
17
17
  "first name": {
18
- message: "First name is required",
18
+ message: "First name is required and cannot be empty",
19
19
  validate: (v) => !!v && String(v).trim() !== "",
20
20
  },
21
21
 
22
22
  "last name": {
23
- message: "Last name is required",
23
+ message: "Last name is required and cannot be empty",
24
24
  validate: (v) => !!v && String(v).trim() !== "",
25
25
  },
26
26
 
27
27
  email: {
28
- message: "Email is required or invalid",
28
+ message: "A valid email address is required",
29
29
  validate: (v) => !!v && isValidEmail(v),
30
30
  },
31
31
 
32
32
  "mobile number": {
33
- message: "Mobile number is required or invalid",
33
+ message: "A valid Indian mobile number is required",
34
34
  validate: (v) => !!v && isValidIndianMobile(v),
35
35
  },
36
36
 
37
37
  // "company": {
38
- // message: "Company is required",
38
+ // message: "Company name is required",
39
39
  // validate: (v) => !!v && String(v).trim() !== "",
40
40
  // },
41
41
 
42
42
  badge1: {
43
- message: "Badge ID is required or must be a 5-digit number",
43
+ message: "Badge ID is required and must be exactly 5 digits",
44
44
  validate: (v) => !!v && /^\d{5}$/.test(String(v).trim()),
45
45
  },
46
46
 
47
47
  "issuedate-b1": {
48
- message: "Issue date is required or invalid",
48
+ message: "Issue date is required and must be in DD/MM/YYYY format",
49
49
  validate: (v) => !!v && isValidDate(v),
50
50
  },
51
51
 
52
52
  // "location-b1": {
53
- // message: "Location is required",
53
+ // message: "Location is required and cannot be empty",
54
54
  // validate: (v) => !!v && String(v).trim() !== "",
55
55
  // },
56
56
  };