fix object serialization test issue
This commit is contained in:
parent
5c318932c2
commit
2b2c7d7f9f
1 changed files with 5 additions and 9 deletions
|
@ -248,15 +248,11 @@ function metaToValue (meta) {
|
||||||
|
|
||||||
// Construct a plain object from the meta.
|
// Construct a plain object from the meta.
|
||||||
function metaToPlainObject (meta) {
|
function metaToPlainObject (meta) {
|
||||||
if (meta.type === 'error') return new Error()
|
const obj = (() => meta.type === 'error' ? new Error() : {})()
|
||||||
|
for (let i = 0; i < meta.members.length; i++) {
|
||||||
const obj = {}
|
let {name, value} = meta.members[i]
|
||||||
const members = meta.members
|
obj[name] = value
|
||||||
|
}
|
||||||
members.forEach((member) => {
|
|
||||||
const {key, value} = member
|
|
||||||
obj[key] = value
|
|
||||||
})
|
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue