Skip to content

Commit

Permalink
feat(operation_type)!: add toShortString method
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 18, 2022
1 parent e4ef28e commit 68caba9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/src/core/operation_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ enum OperationType {
/// Corresponds with the `unsubscribeevent` operation type.
unsubscribeevent,
}

/// Adds a [toShortString] function to the [OperationType] enum.
extension ParseToString on OperationType {
/// Creates a String representation with the leading "OperationType".
String toShortString() {
return toString().split('.').last;
}
}

0 comments on commit 68caba9

Please sign in to comment.