fix(Local File Trigger Node): Add chokidar dependency back (#18260)

This commit is contained in:
Elias Meire
2025-08-14 09:26:42 +02:00
committed by GitHub
parent b39835ad76
commit 9043869b10
5 changed files with 123 additions and 131 deletions

View File

@@ -1,4 +1,5 @@
import { watch } from 'chokidar';
import type { EventName } from 'chokidar/handler';
import {
type ITriggerFunctions,
type IDataObject,
@@ -233,11 +234,11 @@ export class LocalFileTrigger implements INodeType {
const path = this.getNodeParameter('path') as string;
const options = this.getNodeParameter('options', {}) as IDataObject;
let events: string[];
let events: EventName[];
if (triggerOn === 'file') {
events = ['change'];
} else {
events = this.getNodeParameter('events', []) as string[];
events = this.getNodeParameter('events', []) as EventName[];
}
const ignored = options.ignored === '' ? undefined : (options.ignored as string);
const watcher = watch(path, {
@@ -259,7 +260,7 @@ export class LocalFileTrigger implements INodeType {
};
for (const eventName of events) {
watcher.on(eventName, (pathString) => executeTrigger(eventName, pathString as string));
watcher.on(eventName, (pathString: string) => executeTrigger(eventName, pathString));
}
async function closeFunction() {