Skip to content
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