( selectedTags: RegistryTag[] = [], )
| 7 | const components = registry.items as unknown as RegistryItem[]; |
| 8 | |
| 9 | export 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 | |
| 21 | export const getComponentsByNames = (names: string[]): RegistryItem[] => { |
| 22 | const componentsMap = new Map(components.map((comp) => [comp.name, comp])); |
no outgoing calls
no test coverage detected