toon-formatter 1.0.3 → 1.1.1

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/README.md CHANGED
@@ -145,8 +145,8 @@ const csvResult = csvToToonSync(csvMixedText);
145
145
  ```
146
146
 
147
147
  **Important Notes:**
148
- - ✅ **Supports mixed text**: `jsonToToon`, `xmlToToon`, `csvToToon`, `yamlToToon`
149
- - ❌ **Pure data only**: `toonToJson`, `toonToXml`, `toonToCsv`, `toonToYaml`
148
+ - ✅ **Supports mixed text**: `jsonToToon`, `xmlToToon`, `csvToToon`
149
+ - ❌ **Pure data only**: `yamlToToon`, `toonToJson`, `toonToXml`, `toonToCsv`, `toonToYaml`
150
150
 
151
151
  ### Using the ToonConverter Class
152
152
 
@@ -251,7 +251,7 @@ Mixed text support allows you to convert data that's embedded within regular tex
251
251
  | `jsonToToon()` | ✅ | ✅ | Extracts all JSON objects/arrays |
252
252
  | `xmlToToon()` | ✅ | ✅ | Extracts all XML elements |
253
253
  | `csvToToon()` | ✅ | ✅ | Extracts CSV tables |
254
- | `yamlToToon()` | ✅ | | Extracts YAML blocks |
254
+ | `yamlToToon()` | ✅ | | Pure YAML only |
255
255
  | `toonToJson()` | ✅ | ❌ | Pure TOON only |
256
256
  | `toonToXml()` | ✅ | ❌ | Pure TOON only |
257
257
  | `toonToCsv()` | ✅ | ❌ | Pure TOON only |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toon-formatter",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "funding": {
5
5
  "type": "github",
6
6
  "url": "https://github.com/sponsors/ankitpal181"
package/src/utils.js CHANGED
@@ -232,5 +232,12 @@ export function extractCsvFromString(text) {
232
232
  resultLines.push(line);
233
233
  }
234
234
 
235
- return resultLines.join('\n').trim();
235
+ const result = resultLines.join('\n').trim();
236
+
237
+ // Avoid matching TOON arrays (e.g. users[2]{id,name}:)
238
+ if (/^\s*(\w+)?\[\d+\]/.test(result)) {
239
+ return null;
240
+ }
241
+
242
+ return result;
236
243
  }