We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f7815c commit 42ed459Copy full SHA for 42ed459
packages/core/src/validation/assertions.ts
@@ -23,9 +23,12 @@ export function assertUserIdentity(event: CoreSegmentEvent): void {
23
export function assertEventExists(
24
event?: CoreSegmentEvent | null
25
): asserts event is CoreSegmentEvent {
26
- if (!event || typeof event !== 'object') {
+ if (!exists(event)) {
27
throw new ValidationError('Event', nilError)
28
}
29
+ if (typeof event !== 'object') {
30
+ throw new ValidationError('Event', objError)
31
+ }
32
33
34
export function assertEventType(event: CoreSegmentEvent): void {
0 commit comments