mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
Fix #176 switching between choices
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user