Created
August 10, 2022 09:39
-
-
Save dkacper/f6f293752952c8ae0cf89cd9ad7a30cd to your computer and use it in GitHub Desktop.
Abstract Mapper
This file contains 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
export abstract class Mapper<TDomain, TDto = unknown> { | |
// public static map: Mapper<TDomain, TDto>; Add this property to a mapper to access methods like they were static. | |
public abstract toDto?: (domain: TDomain) => TDto; | |
public abstract toDomain?: (dto: TDto) => TDomain; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment