feat: add parseTree type check

This commit is contained in:
夜鹰 2022-08-04 14:56:20 +08:00
parent fe43cf39a4
commit 669c8b1ac6

View File

@ -55,9 +55,10 @@ export const parseTree = (key, value, level = 0) => {
children: data ? Object.keys(data).map((it) => parseTree(it, data[it], level + 1)) : [],
};
}
// * value is string & number & null
return {
name: key,
value,
value: value == null ? '' : value.toString(),
description: '',
type: whatType(value),
required: true,