This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Contains extension methods to format the type name. | |
| /// </summary> | |
| public static class TypeFormattingExtensions | |
| { | |
| /// <summary> | |
| /// Builds the pretty full name of the specified type. | |
| /// <remarks> | |
| /// Specially for generic types the resulting full name is more redeable. | |
| /// </remarks> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class EnumerableExtension | |
| { | |
| public static bool IsNullOrEmpty(this IEnumerable enumerable) | |
| { | |
| if (enumerable == null) | |
| { | |
| return true; | |
| } | |
| return !enumerable.GetEnumerator().MoveNext(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ExceptionExtension | |
| { | |
| public static string GetDetails(this Exception exception, StringBuilder sb = null) | |
| { | |
| if (exception == null) | |
| { | |
| return sb?.ToString() ?? string.Empty; | |
| } | |
| if (sb == null) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { fromJS } from 'immutable'; | |
| import check from 'check-types'; | |
| class Enum { | |
| constructor(constants, enumType = '') { | |
| if (check.not.array(constants) && check.not.object(constants)) { | |
| throw new TypeError('The enum constants must be an array or an object.'); | |
| } |