function isTextType(filepath) {
  if (!fs.existsSync(filepath)) return false;
  const result = isKnownTextMime(filepath);
  if (result.valid) return true; // Known text type - return true.
  if (result.reason !== "generic") return false; // If any other reason than generic - return false.
  return parseableAsText(filepath); // Fallback to parsing as text via buffer inspection.
}
Checks if a file is text by checking the mime type and then falling back to buffer inspection.
This way we can capture all the cases where the mime type is not known but still parseable as text
without having to constantly add new mime type overrides.
@param {string} filepath - The path to the file.
@returns {boolean} - Returns true if the file is text, false otherwise.