parseBoolean = (value) => {
  if (typeof value === "boolean") {
    return value;
  }

  if (typeof value === "string") {
    if (value.toLowerCase() === "true") {
      return true;
    } else if (value.toLowerCase() === "false") {
      return false;
    }
  }
  return undefined;
}
Returns boolean if value is either "true" or "false" else the value as it is.

@param {string | boolean} value The value to parse.
@returns {boolean | undefined } The parsed value.