Return BindingType directly from promptForBindingType (#19200)

* Return BindingType directly from promptForBindingType

* align

* Fix tests

* fix compile
This commit is contained in:
Charles Gagnon
2022-04-25 14:07:03 -07:00
committed by GitHub
parent 72a43854f8
commit d54b7b9970
6 changed files with 16 additions and 15 deletions

View File

@@ -284,7 +284,7 @@ export async function isFunctionProject(folderPath: string): Promise<boolean> {
/**
* Prompts the user to select type of binding and returns result
*/
export async function promptForBindingType(): Promise<(vscode.QuickPickItem & { type: BindingType }) | undefined> {
export async function promptForBindingType(): Promise<BindingType | undefined> {
const inputOutputItems: (vscode.QuickPickItem & { type: BindingType })[] = [
{
label: constants.input,
@@ -302,7 +302,7 @@ export async function promptForBindingType(): Promise<(vscode.QuickPickItem & {
ignoreFocusOut: true
}));
return selectedBinding;
return selectedBinding?.type;
}
/**