Skip to content

Commit

Permalink
chore(apiWatch): constraint deep passes boolean (#9952)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue authored Jan 3, 2024
1 parent 10ccb9b commit fe03b2f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/runtime-core/src/apiWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fe03b2f

Please sign in to comment.