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.
		
		
		
		
		
			
		
			
				
					
					
						
							25 lines
						
					
					
						
							631 B
						
					
					
				
			
		
		
	
	
							25 lines
						
					
					
						
							631 B
						
					
					
				// 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)
 | 
						|
}
 | 
						|
 | 
						|
export const buttonTypeValidator = (value) => {
 | 
						|
  if (typeof value !== "string") {
 | 
						|
    return false
 | 
						|
  }
 | 
						|
  return ["primary", "primary-alternative", "secondary", "black", "success", "info", "warning", "danger"].includes(value)
 | 
						|
}
 | 
						|
 |