func hasCategory()

in packages/package.go [424:440]


func hasCategory(categories []string, category string) bool {
	if slices.Contains(categories, category) {
		return true
	}

	// Check if this category has subcategories, and the package contains any of them.
	for _, subcategory := range Categories {
		if subcategory.Parent == nil || subcategory.Parent.Name != category {
			continue
		}

		if slices.Contains(categories, subcategory.Name) {
			return true
		}
	}
	return false
}