Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 6a87fd1

Browse files
committed
fix: make attributes type more specific
1 parent fa4b84e commit 6a87fd1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type TerraformStateResource = {
9090
type: string;
9191
name: string;
9292
provider: string;
93-
instances: [{ attributes: Record<string, any> }];
93+
instances: [{ attributes: Record<string, JsonValue> }];
9494
};
9595

9696
export interface TerraformState {

windows-rdp/main.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ function findWindowsRdpScript(state: TerraformState): string | null {
2323
}
2424

2525
for (const instance of resource.instances) {
26-
if (instance.attributes.display_name === "windows-rdp") {
26+
if (
27+
instance.attributes.display_name === "windows-rdp" &&
28+
typeof instance.attributes.script === "string"
29+
) {
2730
return instance.attributes.script;
2831
}
2932
}

0 commit comments

Comments
 (0)