Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Commit 7438f3a

Browse files
committed
toJson support array
1 parent e72a7a1 commit 7438f3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export function toJson(data, indent = 4) {
3939
if(isGenerator(value)) {
4040
return `[generator ${key || "Generator"}]`;
4141
}
42+
if(Array.isArray(value)) {
43+
return value;
44+
}
4245
let obj = {};
4346
for(const i in value) {
4447
obj[i] = value[i];

0 commit comments

Comments
 (0)