You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/frontend/src/utilities/form.ts

16 lines
261 B

function validation<T>(condition: (value: T) => boolean, message: string) {
return (value: T) => {
if (condition(value)) {
return null;
} else {
return message;
}
};
}
const FormUtils = {
validation,
};
export default FormUtils;