File size: 280 Bytes
450060f
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
export const getValidBoolean = (something: any, defaultValue: boolean) => {
  if (typeof something === "boolean") {
    return something
  }

  const strValue = `${something || defaultValue}`.toLowerCase()
  
  return strValue === "true" || strValue === "1" || strValue === "on"
}