https://levelup.gitconnected.com/implementing-type-constraints-with-generics-in-typescript-823a8e74855c