mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
10 lines
212 B
TypeScript
10 lines
212 B
TypeScript
export function parseCSV(csv: string, removeEmptyItems = true): string[] {
|
|
const items = csv.split(',').map((item) => item.trim());
|
|
|
|
if (removeEmptyItems) {
|
|
return items.filter(Boolean);
|
|
}
|
|
|
|
return items;
|
|
}
|