Fix #176 switching between choices

This commit is contained in:
Misode
2021-10-06 00:02:06 +02:00
parent d883459dba
commit 0ff7de3aea
7 changed files with 22 additions and 33 deletions

View File

@@ -140,17 +140,3 @@ export function deepEqual(a: any, b: any) {
}
return a !== a && b !== b
}
export function unwrapLists(value: any): any {
if (Array.isArray(value)) {
return value.map(v => unwrapLists(v.node))
} else if (typeof value === 'object' && value !== null) {
const res: Record<string, any> = {}
Object.entries(value).map(([k, v]) => {
res[k] = unwrapLists(v)
})
return res
} else {
return value
}
}