Skip to content

Commit

Permalink
fix: exception status reference
Browse files Browse the repository at this point in the history
  • Loading branch information
cicec committed Aug 17, 2021
1 parent aa5ddc2 commit e20fcb1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { toJS } from 'mobx'

export const is = {
fun: (a: unknown): a is Function => typeof a === 'function',
arr: (a: unknown): a is [] => Array.isArray(a),
Expand Down Expand Up @@ -25,7 +27,7 @@ export const toData = (source: any): any => {
const target: AnyObject = {}

getPropertyNames(source).forEach(key => {
target[key] = toData(source[key])
target[key] = toJS(toData(source[key]))
})

return target
Expand All @@ -35,8 +37,8 @@ export const toData = (source: any): any => {
const obj = Object.fromEntries(source)
const target: AnyObject = {}

getPropertyNames(source).forEach(key => {
target[key] = toData(obj[key])
getPropertyNames(obj).forEach(key => {
target[key] = toJS(toData(obj[key]))
})

return target
Expand Down

0 comments on commit e20fcb1

Please sign in to comment.