refactor(reactivity): avoid optional chaining in getDepFromReactive (#12007)

This commit is contained in:
yangxiuxiu 2024-09-24 18:02:01 +08:00 committed by GitHub
parent 7a00f6f093
commit c0e9434414
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -378,13 +378,10 @@ export function trigger(
endBatch()
}
/**
* Test only
*/
export function getDepFromReactive(
object: any,
key: string | number | symbol,
): Dep | undefined {
// eslint-disable-next-line
return targetMap.get(object)?.get(key)
const depMap = targetMap.get(object)
return depMap && depMap.get(key)
}