Skip to content

Commit

Permalink
fix: stringify functions in toRawDeep (#152)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Chau <[email protected]>
  • Loading branch information
bounoable and Akryum authored Jul 6, 2022
1 parent 49928ae commit 30077c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/histoire/src/client/app/util/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const isObject = (val) => val !== null && typeof val === 'object'

export function toRawDeep (val, seen = new Set()) {
const unwrappedValue = isRef(val) ? unref(val) : val
const valueType = typeof unwrappedValue

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

Expand Down

0 comments on commit 30077c0

Please sign in to comment.