@@ -43,7 +43,6 @@ import { DeprecationTypes } from './compat/compatConfig'
43
43
import { checkCompatEnabled , isCompatEnabled } from './compat/compatConfig'
44
44
import { ObjectWatchOptionItem } from './componentOptions'
45
45
import { useSSRContext } from '@vue/runtime-core'
46
- import { SSRContext } from '@vue/server-renderer'
47
46
48
47
export type WatchEffect = ( onCleanup : OnCleanup ) => void
49
48
@@ -297,7 +296,7 @@ function doWatch(
297
296
] )
298
297
}
299
298
if ( flush === 'sync' ) {
300
- const ctx = useSSRContext ( ) as SSRContext
299
+ const ctx = useSSRContext ( ) !
301
300
ssrCleanup = ctx . __watcherHandles || ( ctx . __watcherHandles = [ ] )
302
301
} else {
303
302
return NOOP
@@ -318,9 +317,7 @@ function doWatch(
318
317
deep ||
319
318
forceTrigger ||
320
319
( isMultiSource
321
- ? ( newValue as any [ ] ) . some ( ( v , i ) =>
322
- hasChanged ( v , ( oldValue as any [ ] ) [ i ] )
323
- )
320
+ ? ( newValue as any [ ] ) . some ( ( v , i ) => hasChanged ( v , oldValue [ i ] ) )
324
321
: hasChanged ( newValue , oldValue ) ) ||
325
322
( __COMPAT__ &&
326
323
isArray ( newValue ) &&
@@ -461,7 +458,7 @@ export function traverse(value: unknown, seen?: Set<unknown>) {
461
458
} )
462
459
} else if ( isPlainObject ( value ) ) {
463
460
for ( const key in value ) {
464
- traverse ( ( value as any ) [ key ] , seen )
461
+ traverse ( value [ key ] , seen )
465
462
}
466
463
}
467
464
return value
0 commit comments