Skip to content

Commit

Permalink
Add type cast to string as the recent update of json-stable-stringify…
Browse files Browse the repository at this point in the history
… returns string|undefined which is incompatible with some places we use it
  • Loading branch information
ansgarm committed Jan 6, 2025
1 parent f3790b9 commit 69efb25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cdktf/lib/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class Manifest implements IManifest {
public writeToFile() {
fs.writeFileSync(
path.join(this.outdir, Manifest.fileName),
stringify(this.buildManifest(), { space: 2 })
stringify(this.buildManifest(), { space: 2 }) as string
);
}
}
4 changes: 2 additions & 2 deletions packages/cdktf/lib/synthesize/synthesizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class StackSynthesizer implements IStackSynthesizer {

fs.writeFileSync(
path.join(session.outdir, stackManifest.stackMetadataPath!),
stringify(hcl.metadata, { space: 2 })
stringify(hcl.metadata, { space: 2 }) as string
);

return;
Expand All @@ -108,7 +108,7 @@ export class StackSynthesizer implements IStackSynthesizer {

fs.writeFileSync(
path.join(session.outdir, stackManifest.synthesizedStackPath),
stringify(jsonTfConfig, { space: 2 })
stringify(jsonTfConfig, { space: 2 }) as string
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cdktf/lib/testing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class Testing {
}
const cleaned = removeMetadata(tfConfig);

return stringify(cleaned, { space: 2 });
return stringify(cleaned, { space: 2 }) as string;
}

/**
Expand Down

0 comments on commit 69efb25

Please sign in to comment.