Skip to content

Commit 53beb42

Browse files
use default parameters
1 parent 243dedc commit 53beb42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/features/ExternalApi.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ export class ExternalApiFeature implements IFeature {
8282
RETURNS:
8383
true if it worked, otherwise throws an error.
8484
*/
85-
vscode.commands.registerCommand("PowerShell.UnregisterExternalExtension", (uuid: string): boolean => {
85+
vscode.commands.registerCommand("PowerShell.UnregisterExternalExtension", (uuid: string = ""): boolean => {
8686
log.writeDiagnostic(`Unregistering extension with session UUID: ${uuid}`);
87-
if (!uuid && !ExternalApiFeature.registeredExternalExtension.delete(uuid)) {
87+
if (!ExternalApiFeature.registeredExternalExtension.delete(uuid)) {
8888
throw new Error(`No extension registered with session UUID: ${uuid}`);
8989
}
9090
return true;
@@ -109,8 +109,8 @@ export class ExternalApiFeature implements IFeature {
109109
architecture: string;
110110
}
111111
*/
112-
vscode.commands.registerCommand("PowerShell.GetPowerShellVersionDetails", async (uuid: string): Promise<IExternalPowerShellDetails> => {
113-
if (!uuid && !ExternalApiFeature.registeredExternalExtension.has(uuid)) {
112+
vscode.commands.registerCommand("PowerShell.GetPowerShellVersionDetails", async (uuid: string = ""): Promise<IExternalPowerShellDetails> => {
113+
if (!ExternalApiFeature.registeredExternalExtension.has(uuid)) {
114114
throw new Error(
115115
"UUID provided was invalid, make sure you execute the 'PowerShell.GetPowerShellVersionDetails' command and pass in the UUID that it returns to subsequent command executions.");
116116
}

0 commit comments

Comments
 (0)