mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Local File Trigger Node): Add chokidar dependency back (#18260)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user