@websolutespa/bom-llm 0.0.30 → 0.0.31

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/bom-llm
2
2
 
3
+ ## 0.0.31
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: textToChunks
8
+
3
9
  ## 0.0.30
4
10
 
5
11
  ### Patch Changes
package/dist/umd/index.js CHANGED
@@ -19343,11 +19343,16 @@ ${Object.entries(vars).map(_ref2 => {
19343
19343
  let chunks = [];
19344
19344
  let didError = false;
19345
19345
  try {
19346
- let replacedText = textToChunksLastUnparsed.text + text;
19347
- replacedText = replacedText.replace(/(,$)/, '');
19348
- console.log('replacedText', replacedText);
19349
- const jsonChunks = JSON.parse(`[${replacedText}]`);
19350
- chunks = jsonChunks;
19346
+ // console.log('textToChunks.text', text);
19347
+ if (text.match(/(",|},|],)$/)) {
19348
+ const textToReplace = textToChunksLastUnparsed.text + text;
19349
+ const replacedText = textToReplace.replace(/(,$)/, '');
19350
+ // console.log('textToChunks.replacedText', replacedText);
19351
+ const jsonChunks = JSON.parse(`[${replacedText}]`);
19352
+ chunks = jsonChunks;
19353
+ } else {
19354
+ textToChunksLastUnparsed.text += text;
19355
+ }
19351
19356
  } catch (error) {
19352
19357
  console.log('textToChunks.error', error, text);
19353
19358
  didError = true;