Answer the question
In order to leave comments, you need to log in
How to get a list of fields from the interface?
There is an interface
export interface Credentials {
login: string | undefined;
password: string | undefined;
}
const credTester: Record<'login' | 'password', RegExp> = {
login: /^[0-9a-zA-Z]*$/,
password: /^[[email protected]#.]*$/
};
Answer the question
In order to leave comments, you need to log in
const credTester: Record<keyof Credentials, RegExp> = {
login: /^[0-9a-zA-Z]*$/,
password: /^[[email protected]#.]*$/
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question