Skip to content

Commit

Permalink
Avoid conditioning twice.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 30, 2024
1 parent b973d79 commit 78010e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/src/tester/ChapterOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export class ChapterOutput {
if (!output) return { evaluation: { result: Result.SKIPPED } }
const chapter_output = new ChapterOutput({})
for (const [name, output_value] of Object.entries(output)) {
const path: string = typeof output_value === 'string' ? output_value : output_value.path
const default_value = typeof output_value === 'string' ? undefined : output_value.default
const [path, default_value] = (typeof output_value === 'string')
? [output_value, undefined]
: [output_value.path, output_value.default]
let value: any
if (path == 'payload' || path.startsWith('payload.') || path.match(/^payload\[\d*\]/)) {
if (response.payload === undefined) {
Expand Down

0 comments on commit 78010e0

Please sign in to comment.