generated from tailored/router-db-template
fix: add split and for sleep post data
This commit is contained in:
8
packages/xhs/src/test/split-text.ts
Normal file
8
packages/xhs/src/test/split-text.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { splitContent } from '../routes/mentions/mention.ts';
|
||||
|
||||
const content = `这是一个测试内容,长度超过300个字符。34`.repeat(43); // 模拟一个超过300个字符的内容
|
||||
const maxLength = 300;
|
||||
const parts = splitContent(content, maxLength);
|
||||
console.log('分割后的内容:', parts);
|
||||
// 输出分割后的内容
|
||||
console.log('分割后的内容长度:', parts.map(part => part.length));
|
||||
Reference in New Issue
Block a user