MCPcopy Create free account
hub / github.com/codedogQBY/ReadAny / splitEditableList

Function splitEditableList

packages/core/src/utils/book-metadata.ts:103–115  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

101}
102
103export 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
117export function joinEditableList(values?: string[]): string {
118 return (values || []).filter(Boolean).join(", ");

Callers 7

BookDetailsScreenFunction · 0.90
TagFieldFunction · 0.90
parseStringListFunction · 0.90
BookDetailsDialogFunction · 0.90
TagSelectorFunction · 0.90
buildBookMetadataUpdateFunction · 0.85

Calls 2

addMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected