MCPcopy
hub / github.com/vladmandic/sdnext / constructor

Method constructor

ui/autocomplete_xn.ts:51–58  ·  view source on GitHub ↗
(items: XnItem[])

Source from the content-addressed store, hash-verified

49 items: SearchItem[];
50
51 constructor(items: XnItem[]) {
52 // items: [{ name, display }]. Sorted in-place by lowercase name.
53 this.items = items.map(({ name, display }) => ({
54 name: String(name).toLowerCase(),
55 display: display ?? name,
56 }));
57 this.items.sort((a, b) => a.name.localeCompare(b.name));
58 }
59
60 search(prefix: string, limit = 20): SearchItem[] {
61 const query = String(prefix).toLowerCase();

Callers

nothing calls this directly

Calls 2

StringInterface · 0.85
sortMethod · 0.45

Tested by

no test coverage detected