Skip to content

Commit

Permalink
Fix typing from #80
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelRobitaille committed Feb 8, 2024
1 parent d867bc8 commit bbf6e56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ export class CommandHandler {
// Find all objects where command is shellCommand.execute nested anywhere in the input object.
// It could be that the actual input being run is nested inside an input from another extension.
// See https://github.com/augustocdias/vscode-shell-command/issues/79
function *deepSearch(obj: any): Generator<Input> {
if (obj.command === "shellCommand.execute") {
yield obj;
function *deepSearch(obj: { command?: string, [x: string]: any }): Generator<Input> {

Check warning on line 195 in src/lib/CommandHandler.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
if (obj?.command === "shellCommand.execute") {
yield obj as Input;
}
for (let key in obj) {
if (typeof obj[key] === 'object') {
yield* deepSearch(obj[key]);
for (const value in Object.values(obj)) {
if (typeof value === 'object') {
yield* deepSearch(value);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/VariableResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from 'path';
import { UserInputContext } from './UserInputContext';

export type Input = {
command: "shellCommand.execute";
args: {
taskId: string;
command: string | string[];
Expand Down

0 comments on commit bbf6e56

Please sign in to comment.