Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: serde generic events
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Sep 10, 2018
1 parent c034397 commit aea46a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/model/pattern-property/event-handler-property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ function deserializeEventType(type: Types.SerializedPatternEventType): Types.Pat
return Types.PatternEventType.ChangeEvent;
case 'MouseEvent':
return Types.PatternEventType.MouseEvent;
case 'Event':
default:
throw new Error(`Unknown event type: ${type}`);
return Types.PatternEventType.Event;
}
}

Expand All @@ -147,7 +148,8 @@ function serializeEventType(type: Types.PatternEventType): Types.SerializedPatte
return 'ChangeEvent';
case Types.PatternEventType.MouseEvent:
return 'MouseEvent';
case Types.PatternEventType.Event:
default:
throw new Error(`Unknown event type: ${type}`);
return 'Event';
}
}

0 comments on commit aea46a3

Please sign in to comment.