export const toBoolean = ({ value }: { value: unknown }): unknown => {
  if (typeof value === 'string') {
    const normalized = value.trim().toLowerCase();
    if (normalized === 'true') {
      return true;
    }
    if (normalized === 'false') {
      return false;
    }
  }

  if (value === true || value === false) {
    return value;
  }

  return value;
};
