cloud-ide-model-schema 1.1.145 → 1.1.146

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.
@@ -21,8 +21,16 @@ var auth_user_mst = new mongoose_1.Schema({
21
21
  },
22
22
  user_middlename: {
23
23
  type: String,
24
- minlength: 3,
25
- maxlength: 20
24
+ maxlength: 20,
25
+ // Allow empty strings - middle name is optional
26
+ validate: {
27
+ validator: function (value) {
28
+ // If value is provided and not empty, it must be at least 3 characters
29
+ // If value is empty or undefined, it's valid (optional field)
30
+ return !value || value.trim().length === 0 || value.trim().length >= 3;
31
+ },
32
+ message: 'Middle name must be at least 3 characters if provided'
33
+ }
26
34
  },
27
35
  user_lastname: {
28
36
  type: String,
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript": "^5.8.3"
10
10
  },
11
11
  "name": "cloud-ide-model-schema",
12
- "version": "1.1.145",
12
+ "version": "1.1.146",
13
13
  "description": "Pachage for schema management of Cloud IDEsys LMS",
14
14
  "main": "lib/index.js",
15
15
  "types": "lib/index.d.ts",