@zodic/shared 0.0.206 → 0.0.207

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.
@@ -51,6 +51,7 @@ export class ConceptService {
51
51
 
52
52
  let attempts = 0;
53
53
  const maxAttempts = 3;
54
+ const MAX_NAME_LENGTH = 44;
54
55
 
55
56
  while (attempts < maxAttempts) {
56
57
  let phase = 'generation';
@@ -86,14 +87,19 @@ export class ConceptService {
86
87
 
87
88
  console.log(`🎭 Generated names: EN - "${nameEN}", PT - "${namePT}"`);
88
89
 
89
- // ✅ Name length check
90
- const MAX_NAME_LENGTH = 44;
91
- if (nameEN.length > MAX_NAME_LENGTH || namePT.length > MAX_NAME_LENGTH) {
92
- console.warn(`⚠️ Name too long: "${nameEN}" | "${namePT}". Retrying...`);
93
- allNamesEN.push(nameEN);
94
- allNamesPT.push(namePT);
95
- continue;
96
- }
90
+ // ✅ Forcefully trim the name to exactly 5 words if it's too long
91
+ const enforceWordLimit = (name: string): string => {
92
+ const words = name.split(/\s+/);
93
+ if (words.length > 5) {
94
+ return words.slice(0, 5).join(' ');
95
+ }
96
+ return name;
97
+ };
98
+
99
+ nameEN = enforceWordLimit(nameEN);
100
+ namePT = enforceWordLimit(namePT);
101
+
102
+ console.log(`✂️ Trimmed names: EN - "${nameEN}", PT - "${namePT}"`);
97
103
 
98
104
  // ✅ Check uniqueness before storing
99
105
  if (allNamesEN.includes(nameEN) || allNamesPT.includes(namePT)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.206",
3
+ "version": "0.0.207",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {