@zodic/shared 0.0.159 → 0.0.160

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.
@@ -233,11 +233,12 @@ export class ConceptService {
233
233
  } {
234
234
  console.log('📌 Parsing basic info response from ChatGPT:', response);
235
235
 
236
+ // ✅ More flexible regex to handle variations in formatting
236
237
  const enMatch = response.match(
237
- /EN:\s*•\s*Name:\s*(.+?)\s*•\s*Description:\s*([\s\S]+?)\s*•\s*Poetic Passage:\s*([\s\S]+?)\s*(?=PT:|$)/
238
+ /EN:\s*(?:•\s*)?Name:\s*(.+?)\s*(?:•\s*)?Description:\s*([\s\S]+?)\s*(?:•\s*)?Poetic Passage:\s*([\s\S]+?)\s*(?=PT:|$)/
238
239
  );
239
240
  const ptMatch = response.match(
240
- /PT:\s*•\s*Nome:\s*(.+?)\s*•\s*Descrição:\s*([\s\S]+?)\s*•\s*Passagem Poética:\s*([\s\S]+)/
241
+ /PT:\s*(?:•\s*)?Nome:\s*(.+?)\s*(?:•\s*)?Descrição:\s*([\s\S]+?)\s*(?:•\s*)?Passagem Poética:\s*([\s\S]+)/
241
242
  );
242
243
 
243
244
  if (!enMatch || !ptMatch) {
@@ -245,7 +246,7 @@ export class ConceptService {
245
246
  throw new Error('Invalid basic info response format');
246
247
  }
247
248
 
248
- // ✅ Function to clean text (removes leading/trailing spaces & unwanted "*")
249
+ // ✅ Function to clean text (removes leading/trailing spaces & unwanted symbols)
249
250
  const cleanText = (text: string) => text.trim().replace(/\*/g, '');
250
251
 
251
252
  // ✅ Parse and clean extracted content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.159",
3
+ "version": "0.0.160",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {