type: improve typing (#177)

This commit is contained in:
扩散性百万甜面包
2019-10-10 02:01:53 +08:00
committed by Evan You
parent 8f1475b8dd
commit def27239bd
5 changed files with 9 additions and 11 deletions

View File

@@ -61,8 +61,7 @@ export function reactive(target: object) {
export function readonly<T extends object>(
target: T
): Readonly<UnwrapNestedRefs<T>>
export function readonly(target: object) {
): Readonly<UnwrapNestedRefs<T>> {
// value is a mutable observable, retrieve its original and return
// a readonly version.
if (reactiveToRaw.has(target)) {