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.
|
||||
function metaToPlainObject (meta) {
|
||||
if (meta.type === 'error') return new Error()
|
||||
|
||||
const obj = {}
|
||||
const members = meta.members
|
||||
|
||||
members.forEach((member) => {
|
||||
const {key, value} = member
|
||||
obj[key] = value
|
||||
})
|
||||
const obj = (() => meta.type === 'error' ? new Error() : {})()
|
||||
for (let i = 0; i < meta.members.length; i++) {
|
||||
let {name, value} = meta.members[i]
|
||||
obj[name] = value
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue