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.
19 lines
408 B
19 lines
408 B
![]()
2 years ago
|
// common validators across base components
|
||
|
|
||
|
import {chamiloIconToClass} from "./ChamiloIcons";
|
||
|
|
||
|
export const iconValidator = (value) => {
|
||
|
if (typeof (value) !== "string") {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return Object.keys(chamiloIconToClass).includes(value);
|
||
|
};
|
||
|
|
||
|
export const sizeValidator = (value) => {
|
||
|
if (typeof value !== "string") {
|
||
|
return false;
|
||
|
}
|
||
|
return ["normal", "small"].includes(value);
|
||
|
}
|