MCPcopy Create free account
hub / github.com/cosscom/coss / getComponents

Function getComponents

apps/origin/lib/utils.ts:9–19  ·  view source on GitHub ↗
(
  selectedTags: RegistryTag[] = [],
)

Source from the content-addressed store, hash-verified

7const components = registry.items as unknown as RegistryItem[];
8
9export const getComponents = (
10 selectedTags: RegistryTag[] = [],
11): RegistryItem[] => {
12 return selectedTags.length
13 ? components.filter((component) =>
14 selectedTags.every(
15 (tag) => component.meta?.tags?.includes(tag) ?? false,
16 ),
17 )
18 : components;
19};
20
21export const getComponentsByNames = (names: string[]): RegistryItem[] => {
22 const componentsMap = new Map(components.map((comp) => [comp.name, comp]));

Callers 1

ComponentsContainerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected