Skip to content

Commit 10e9d38

Browse files
RomainMullerskinny85
authored andcommitted
fix(rosetta): "Rosetta configured for live conversion to undefined" (#1120)
An incorrect update to optional chaining changed the criteria for the target overlap test in Rosetta live conversions and triggered the error in the regular case instead of only in cases where restricts have to be enforced. Reverted to the previous syntax with achieves the correct result.
1 parent 138320c commit 10e9d38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/jsii-rosetta/lib/rosetta.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export class Rosetta {
109109
}
110110

111111
if (!this.options.liveConversion) { return undefined; }
112-
if (!this.options.targetLanguages?.includes(targetLang)) {
113-
throw new Error(`Rosetta configured for live conversion to ${this.options.targetLanguages}, but requested ${targetLang}`);
112+
if (this.options.targetLanguages && !this.options.targetLanguages.includes(targetLang)) {
113+
throw new Error(`Rosetta configured for live conversion to ${this.options.targetLanguages.join(', ')}, but requested ${targetLang}`);
114114
}
115115

116116
// See if we're going to live-convert it with full source information

0 commit comments

Comments
 (0)