File tree 1 file changed +6
-2
lines changed
packages/core/src/composables
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export interface UseFSWatcher {
16
16
* @reactive `workspace.createFileSystemWatcher`
17
17
*/
18
18
export function useFsWatcher (
19
- globPattern : MaybeRefOrGetter < GlobPattern | GlobPattern [ ] > ,
19
+ globPattern : MaybeRefOrGetter < GlobPattern | readonly GlobPattern [ ] | ReadonlySet < GlobPattern > > ,
20
20
ignoreCreateEvents ?: MaybeNullableRefOrGetter < boolean > ,
21
21
ignoreChangeEvents ?: MaybeNullableRefOrGetter < boolean > ,
22
22
ignoreDeleteEvents ?: MaybeNullableRefOrGetter < boolean > ,
@@ -28,7 +28,11 @@ export function useFsWatcher(
28
28
29
29
watchEffect ( ( ) => {
30
30
const globPatternValue = toValue ( globPattern )
31
- const newPatterns = Array . isArray ( globPatternValue ) ? globPatternValue : [ globPatternValue ]
31
+ const newPatterns = Array . isArray ( globPatternValue )
32
+ ? globPatternValue
33
+ : globPatternValue instanceof Set
34
+ ? Array . from ( globPatternValue )
35
+ : [ globPatternValue ]
32
36
for ( const [ pattern , watcher ] of watchers ) {
33
37
if ( ! newPatterns . includes ( pattern ) ) {
34
38
watcher . dispose ( )
You can’t perform that action at this time.
0 commit comments