Skip to content

Commit c66bc0a

Browse files
committed
Added isEventType function from devrev-adaas-typescript.
1 parent 30feeaf commit c66bc0a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/common/helpers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ import { readFileSync } from 'fs';
1414
import * as path from 'path';
1515
import { MAX_DEVREV_FILENAME_EXTENSION_LENGTH, MAX_DEVREV_FILENAME_LENGTH } from './constants';
1616

17+
export function isEventType({
18+
event,
19+
eventType,
20+
}: {
21+
event: AirdropEvent;
22+
eventType: EventType;
23+
}): boolean {
24+
return event.payload.event_type === eventType;
25+
}
26+
1727
export function getTimeoutErrorEventType(eventType: EventType): {
1828
eventType: ExtractorEventType | LoaderEventType;
1929
} {

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export * from './common/install-initial-domain-mapping';
1111
export { WorkerAdapter } from './workers/worker-adapter';
1212
export { processTask } from './workers/process-task';
1313
export { spawn } from './workers/spawn';
14+
export { isEventType } from './common/helpers';
1415

1516
export * from './types/workers';
1617

0 commit comments

Comments
 (0)