File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed
packages/nodes-base/nodes/LocalFileTrigger Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -208,19 +208,20 @@ export class LocalFileTrigger implements INodeType {
208
208
type : 'options' ,
209
209
options : [
210
210
{
211
- name : 'Regex' ,
212
- value : 'regex' ,
213
- description : 'Use regex patterns (e.g., **/*.txt)' ,
211
+ name : 'Match' ,
212
+ value : 'match' ,
213
+ description :
214
+ 'Ignore files using regex patterns (e.g., **/*.txt). Not supported on macOS' ,
214
215
} ,
215
216
{
216
- name : 'Function' ,
217
- value : 'function' ,
218
- description :
219
- 'Wraps the ignored value in a function that checks if the file path includes the ignored value' ,
217
+ name : 'Contain' ,
218
+ value : 'contain' ,
219
+ description : 'Ignore files if their path contains the specified value' ,
220
220
} ,
221
221
] ,
222
- default : 'regex' ,
223
- description : 'Whether to use regex Anymatch patterns or a function to ignore files' ,
222
+ default : 'match' ,
223
+ description :
224
+ 'Whether to ignore files using regex matching (Anymatch patterns) or by checking if the path contains a specified value' ,
224
225
} ,
225
226
] ,
226
227
} ,
@@ -240,7 +241,7 @@ export class LocalFileTrigger implements INodeType {
240
241
}
241
242
const ignored = options . ignored === '' ? undefined : ( options . ignored as string ) ;
242
243
const watcher = watch ( path , {
243
- ignored : options . ignoreMode === 'regex ' ? ignored : ( x ) => x . includes ( ignored as string ) ,
244
+ ignored : options . ignoreMode === 'match ' ? ignored : ( x ) => x . includes ( ignored as string ) ,
244
245
persistent : true ,
245
246
ignoreInitial :
246
247
options . ignoreInitial === undefined ? true : ( options . ignoreInitial as boolean ) ,
Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ describe('LocalFileTrigger', () => {
32
32
jest . clearAllMocks ( ) ;
33
33
} ) ;
34
34
35
- it ( 'should set up chokidar with correct options for folder + regex ignore' , async ( ) => {
35
+ it ( 'should set up chokidar with correct options for folder + match ignore' , async ( ) => {
36
36
( context . getNodeParameter as jest . Mock )
37
37
. mockReturnValueOnce ( 'folder' )
38
38
. mockReturnValueOnce ( '/some/folder' )
39
39
. mockReturnValueOnce ( {
40
40
ignored : '**/*.txt' ,
41
- ignoreMode : 'regex ' ,
41
+ ignoreMode : 'match ' ,
42
42
ignoreInitial : true ,
43
43
followSymlinks : true ,
44
44
depth : 1 ,
@@ -64,13 +64,13 @@ describe('LocalFileTrigger', () => {
64
64
expect ( mockWatcher . on ) . toHaveBeenCalledWith ( 'add' , expect . any ( Function ) ) ;
65
65
} ) ;
66
66
67
- it ( 'should wrap ignored in function for ignoreMode=function ' , async ( ) => {
67
+ it ( 'should wrap ignored in function for ignoreMode=contain ' , async ( ) => {
68
68
( context . getNodeParameter as jest . Mock )
69
69
. mockReturnValueOnce ( 'folder' )
70
70
. mockReturnValueOnce ( '/folder' )
71
71
. mockReturnValueOnce ( {
72
72
ignored : 'node_modules' ,
73
- ignoreMode : 'function ' ,
73
+ ignoreMode : 'contain ' ,
74
74
} )
75
75
. mockReturnValueOnce ( [ 'change' ] ) ;
76
76
You can’t perform that action at this time.
0 commit comments