src/vs/workbench/contrib/terminal/browser/terminalActions.ts/convertOptionsOrProfileToOptions
function convertOptionsOrProfileToOptions(optionsOrProfile?: ICreateTerminalOptions | ITerminalProfile): ICreateTerminalOptions | undefined {
	if (typeof optionsOrProfile === 'object' && 'profileName' in optionsOrProfile) {
		return { config: optionsOrProfile as ITerminalProfile };
	}
	return optionsOrProfile;
}