Skip to content

Commit

Permalink
fix: lint errors, no-mixed-operators, no-trailing-spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tabrindle committed Feb 11, 2021
1 parent c7d585e commit 27ac251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/response-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class ResponseGenerator {
return schemaResponse.example;

if(schemaResponse.examples && Object.values(schemaResponse.examples).length) {
if(preferredExampleName)
return schemaResponse.examples[preferredExampleName] && schemaResponse.examples[preferredExampleName].value || Object.values(schemaResponse.examples)[0].value;
if(preferredExampleName && schemaResponse.examples[preferredExampleName])
return schemaResponse.examples[preferredExampleName].value || Object.values(schemaResponse.examples)[0].value;
return Object.values(schemaResponse.examples)[0].value;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/response-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Response Generator', () => {
value: {
foo: 'bar'
}
}
}
}
};

Expand Down

0 comments on commit 27ac251

Please sign in to comment.