src/vs/workbench/api/common/extHostTerminalService.ts/asTerminalIcon
function asTerminalIcon(iconPath?: vscode.Uri | { light: vscode.Uri; dark: vscode.Uri } | vscode.ThemeIcon): TerminalIcon | undefined {
	if (!iconPath) {
		return undefined;
	}
	if (!('id' in iconPath)) {
		return iconPath;
	}
	return {
		id: iconPath.id,
		color: iconPath.color as ThemeColor
	};
}