(value: string)
| 101 | } |
| 102 | |
| 103 | export function splitEditableList(value: string): string[] { |
| 104 | const seen = new Set<string>(); |
| 105 | const items: string[] = []; |
| 106 | |
| 107 | for (const raw of value.split(/[,,、\n]/)) { |
| 108 | const item = raw.trim(); |
| 109 | if (!item || seen.has(item)) continue; |
| 110 | seen.add(item); |
| 111 | items.push(item); |
| 112 | } |
| 113 | |
| 114 | return items; |
| 115 | } |
| 116 | |
| 117 | export function joinEditableList(values?: string[]): string { |
| 118 | return (values || []).filter(Boolean).join(", "); |
no test coverage detected