Skip to content

Commit

Permalink
fix: Symbol can't be cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jun 8, 2022
1 parent 8958ac5 commit eba5122
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/histoire/src/client/app/util/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const isObject = (val) => val !== null && typeof val === 'object'
export function toRawDeep (val, seen = new Set()) {
const unwrappedValue = isRef(val) ? unref(val) : val

if (typeof unwrappedValue === 'symbol') {
return unwrappedValue.toString()
}

if (seen.has(unwrappedValue)) {
return Array.isArray(unwrappedValue) ? [] : {}
}
Expand Down

0 comments on commit eba5122

Please sign in to comment.