@carecard/validate 2.0.2 → 2.0.4

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/lib/validate.js CHANGED
@@ -65,7 +65,7 @@ const isPasswordString = password => {
65
65
 
66
66
  const isSimplePasswordString = password => {
67
67
  if (password === undefined || typeof password !== "string" || password.length === 0) return false;
68
- const regExPassword = /^[a-zA-Z0-9!@#$%^&*_-]{6,32}$/;
68
+ const regExPassword = /^[a-zA-Z0-9!@#$%^&*_-]{8,24}$/;
69
69
  return regExPassword.test(String(password));
70
70
  }
71
71
 
@@ -86,7 +86,7 @@ const isSimplePasswordStringFailureMessage = (password) => {
86
86
  }
87
87
 
88
88
  const isUsernameString = str => {
89
- if (str === undefined || typeof str !== "string" || str.length === 0) return false;
89
+ if (str === undefined || typeof str !== "string" || str.length === 0 || str.length > 200) return false;
90
90
  return (/^[0-9a-zA-Z]+$/.test(str));
91
91
  }
92
92
 
@@ -6,7 +6,6 @@ const {
6
6
  isValidUuidString,
7
7
  isSimplePasswordString,
8
8
  isPasswordString,
9
- isString6To16CharacterLong,
10
9
  isNameString,
11
10
  isSafeSearchString,
12
11
  isCharactersString,
@@ -40,11 +39,11 @@ function validateProperties( obj ) {
40
39
  break;
41
40
  case "password" :
42
41
  case "new_password" :
43
- isString6To16CharacterLong( value ) && isSimplePasswordString( value ) ?
42
+ isSimplePasswordString( value ) ?
44
43
  returnObj[ key ] = value : null;
45
44
  break;
46
45
  case "strong_password" :
47
- isString6To16CharacterLong( value ) && isPasswordString( value ) ?
46
+ isPasswordString( value ) ?
48
47
  returnObj[ key ] = value : null;
49
48
  break;
50
49
  case "email" :
@@ -67,7 +66,6 @@ function validateProperties( obj ) {
67
66
  case "userId":
68
67
  case "image_id":
69
68
  case "itemId":
70
- case "userId":
71
69
  case "orderId":
72
70
  case "category_id":
73
71
  case "parent_id":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carecard/validate",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/CareCard-ca/pkg-validate.git"