feat(events/handler): accept array of events (#315)

* feat(events/handler): accept array of events

* chore: fmt
This commit is contained in:
veryCrunchy 2024-12-28 01:30:29 +01:00 committed by GitHub
parent 404f23f76e
commit 72ae9e65ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -253,7 +253,7 @@ export class EventHandler extends BaseHandler {
}
onFile(file: FileLoaded<ClientEvent>): ClientEvent[] | undefined {
return file.default ? [file.default] : undefined;
return file.default ? (Array.isArray(file.default) ? file.default : [file.default]) : undefined;
}
callback = (file: ClientEvent): ClientEvent | false => file;