Feat: Convert the data of the messge operator to a string array #3221 (#7853)

### 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:
balibabu
2025-05-26 16:56:50 +08:00
committed by GitHub
parent c7db0eaca6
commit c09bd9fe4a
4 changed files with 33 additions and 5 deletions

View File

@ -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 }));
}