export function cleanCategories()

in tools/cleaner.ts [19:37]


export function cleanCategories(fm: MarkdownFrontmatter): MarkdownFrontmatter {
	let topics: string[] = fm.topics ? fm.topics : [];
	if (fm.technologies) {
		topics = [...fm.technologies, ...topics];
		delete fm.technologies;
	}

	if (fm.products) {
		topics = [...fm.products, ...topics];
		delete fm.products;
	}

	// Now assign to topics, if it contains anything
	if (topics.length) {
		topics.sort();
		fm.topics = topics;
	}
	return fm;
}