mirror of https://github.com/vuejs/core.git
chore(reactivity): remove unnecessary type assertions. (#8046)
This commit is contained in:
parent
37701a88c0
commit
2ce23f0e09
|
@ -414,4 +414,4 @@ export const toReactive = <T extends unknown>(value: T): T =>
|
||||||
* @param value - The value for which a readonly proxy shall be created.
|
* @param value - The value for which a readonly proxy shall be created.
|
||||||
*/
|
*/
|
||||||
export const toReadonly = <T extends unknown>(value: T): T =>
|
export const toReadonly = <T extends unknown>(value: T): T =>
|
||||||
isObject(value) ? readonly(value as Record<any, any>) : value
|
isObject(value) ? readonly(value) : value
|
||||||
|
|
|
@ -432,7 +432,7 @@ export function toRef(
|
||||||
if (isRef(source)) {
|
if (isRef(source)) {
|
||||||
return source
|
return source
|
||||||
} else if (isFunction(source)) {
|
} else if (isFunction(source)) {
|
||||||
return new GetterRefImpl(source as () => unknown) as any
|
return new GetterRefImpl(source) as any
|
||||||
} else if (isObject(source) && arguments.length > 1) {
|
} else if (isObject(source) && arguments.length > 1) {
|
||||||
return propertyToRef(source, key!, defaultValue)
|
return propertyToRef(source, key!, defaultValue)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue