chore(apiWatch): constraint deep passes boolean (#9952)

This commit is contained in:
丶远方 2024-01-03 18:18:45 +08:00 committed by GitHub
parent 10ccb9bfa0
commit fe03b2f8bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -189,6 +189,14 @@ function doWatch(
}
}
// TODO remove in 3.5
if (__DEV__ && deep !== void 0 && typeof deep === 'number') {
warn(
`watch() "deep" option with number value will be used as watch depth in future versions. ` +
`Please use a boolean instead to avoid potential breakage.`,
)
}
if (__DEV__ && !cb) {
if (immediate !== undefined) {
warn(