Skip to content

Commit 6ff12d8

Browse files
authored
Fix the type error (#22)
1 parent 955ce03 commit 6ff12d8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Diff for: lib/plugins/leetcode.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,11 @@ function formatResult(result) {
264264
x.expected_answer = result.expected_output;
265265
x.stdout = result.std_output;
266266
} else {
267-
x.stdout = util.inspect((result.code_output || []).join('\n'));
267+
let output = result.code_output || [];
268+
if (Array.isArray(output)) {
269+
output = output.join('\n');
270+
}
271+
x.stdout = util.inspect(output);
268272
}
269273

270274
// make sure we pass eveything!

Diff for: package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vsc-leetcode-cli",
3-
"version": "2.6.9",
3+
"version": "2.6.10",
44
"description": "A cli tool to enjoy leetcode!",
55
"preferGlobal": "true",
66
"engines": {

0 commit comments

Comments
 (0)