Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Fix the type error #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix the type error
  • Loading branch information
jdneo committed Sep 14, 2019
commit 73b1cb849a66c6612b7abff29b8f6ffe549dc24d
8 changes: 7 additions & 1 deletion lib/plugins/leetcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,13 @@ function formatResult(result) {
x.expected_answer = result.expected_output;
x.stdout = result.std_output;
} else {
x.stdout = util.inspect((result.code_output || []).join('\n'));
let output = result.code_output || [];
if (Array.isArray(output)) {
output = output.join('\n');
} else if (typeof output !== 'string' && !(output instanceof String)) {
output = '';
}
x.stdout = util.inspect(output);
}

// make sure we pass eveything!
Expand Down