fix: make attributes type more specific

This commit is contained in:
Parkreiner
2024-07-19 20:07:59 +00:00
parent fa4b84e8d1
commit 6a87fd18e5
2 changed files with 5 additions and 2 deletions

View File

@@ -90,7 +90,7 @@ type TerraformStateResource = {
type: string; type: string;
name: string; name: string;
provider: string; provider: string;
instances: [{ attributes: Record<string, any> }]; instances: [{ attributes: Record<string, JsonValue> }];
}; };
export interface TerraformState { export interface TerraformState {

View File

@@ -23,7 +23,10 @@ function findWindowsRdpScript(state: TerraformState): string | null {
} }
for (const instance of resource.instances) { for (const instance of resource.instances) {
if (instance.attributes.display_name === "windows-rdp") { if (
instance.attributes.display_name === "windows-rdp" &&
typeof instance.attributes.script === "string"
) {
return instance.attributes.script; return instance.attributes.script;
} }
} }