UNPKG

@voiceflow/base-types

Version:

Voiceflow base project types

13 lines (12 loc) 616 B
// BUILT IN EVENTS export var EventType; (function (EventType) { EventType["INTENT"] = "intent"; EventType["EVENT"] = "event"; EventType["ALEXA"] = "alexa"; })(EventType || (EventType = {})); const ALL_EVENTS_TYPES = Object.values(EventType); export const isBaseEvent = (event) => typeof event === 'object' && event !== null && 'type' in event && typeof event.type === 'string'; export const isIntentEvent = (event) => event.type === EventType.INTENT; export const isEventEvent = (event) => event.type === EventType.EVENT; export const isGeneralEvent = (event) => !ALL_EVENTS_TYPES.includes(event.type);