Combining Brands with Assertion Functions
Here we have the same setup as the previous exercise. There is the PasswordValues
interface and a Valid
Brand.
type Valid<T> = Brand<T, "Valid">;
interface PasswordValues {
password: string;
confirmPassword: string;
}
This time we want to assert that the password is vali
Transcript
0:00 Here we've got the same setup as the previous exercise where we have assertIsValidPassword. We're doing the same thing as we've seen before in this exercise, where we're basically asserting that the password is valid and then creating the user on the API.
0:15 We've got the password values up here, we've got a valid brand, and we need to assert that this thing is a valid password. Good luck!