Skip to content

Commit

Permalink
fix: unwrapRefProxy, resolve vuejs#375
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jun 12, 2020
1 parent ca4350b commit 9f9384f
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions src/reactivity/unwrap.ts
@@ -1,29 +1,16 @@
import { isRef } from './ref'
import { proxy, isFunction, isObject, isArray } from '../utils'
import { proxy, isFunction, isPlainObject, isArray } from '../utils'
import { isReactive } from './reactive'

export function unwrapRefProxy(value: any) {
if (isFunction(value)) {
return value
}

if (isRef(value)) {
return value
}

if (isArray(value)) {
return value
}

if (isReactive(value)) {
return value
}

if (!isObject(value)) {
return value
}

if (!Object.isExtensible(value)) {
if (
isFunction(value) ||
isRef(value) ||
isArray(value) ||
isReactive(value) ||
!isPlainObject(value) ||
!Object.isExtensible(value)
) {
return value
}

Expand Down

0 comments on commit 9f9384f

Please sign in to comment.