mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Convert the data of the messge operator to a string array #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -438,3 +438,19 @@ export const buildCategorizeObjectFromList = (list: Array<ICategorizeItem>) => {
|
||||
return pre;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export function convertToStringArray(
|
||||
list: Array<{ value: string | number | boolean }>,
|
||||
) {
|
||||
if (!Array.isArray(list)) {
|
||||
return [];
|
||||
}
|
||||
return list.map((x) => x.value);
|
||||
}
|
||||
|
||||
export function convertToObjectArray(list: Array<string | number | boolean>) {
|
||||
if (!Array.isArray(list)) {
|
||||
return [];
|
||||
}
|
||||
return list.map((x) => ({ value: x }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user