@3-/aiapi 0.1.48 → 0.1.49
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/fmtJson.js +2 -4
- package/package.json +1 -1
- package/partition.js +2 -3
package/fmtJson.js
CHANGED
|
@@ -3,15 +3,13 @@ import fmtSeg from './fmtSeg.js';
|
|
|
3
3
|
|
|
4
4
|
import partition from './partition.js';
|
|
5
5
|
|
|
6
|
-
import seg from './seg.js';
|
|
7
|
-
|
|
8
6
|
export default async(chat, txt) => {
|
|
9
7
|
var gen, i, pli, result, sum, tmp, txt_li;
|
|
10
8
|
if (!txt) {
|
|
11
9
|
return [];
|
|
12
10
|
}
|
|
13
|
-
txt_li = txt.split('\n');
|
|
14
|
-
pli = (await partition(chat, txt_li
|
|
11
|
+
txt_li = txt.replaceAll('\r\n', '\n').replaceAll('\r', '\n').split('\n');
|
|
12
|
+
pli = (await partition(chat, txt_li));
|
|
15
13
|
result = [];
|
|
16
14
|
sum = 0;
|
|
17
15
|
tmp = [];
|
package/package.json
CHANGED
package/partition.js
CHANGED
|
@@ -39,6 +39,5 @@ const repartition = (chat, len) => async (li) => {
|
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export default (chat, li
|
|
43
|
-
|
|
44
|
-
}
|
|
42
|
+
export default async (chat, li) =>
|
|
43
|
+
partition(li, await seg(chat, li), repartition(chat, li.length))
|