validateName = (name) => {
  if (!name) return false;
  
  const reservedDeviceNames = /^(CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])$/i;
  const firstCharacter = /^[^.\s\-\<>:"/\\|?*\x00-\x1F]/; // no dot, space, or hyphen at start
  const middleCharacters = /^[^<>:"/\\|?*\x00-\x1F]*$/;   // no invalid characters
  const lastCharacter = /[^.\s]$/;  // no dot or space at end, hyphen allowed
  
  if (name.length > 255) return false;          // max name length
  if (reservedDeviceNames.test(name)) return false; // windows reserved names

  return (
    firstCharacter.test(name) &&
    middleCharacters.test(name) &&
    lastCharacter.test(name)
  );
}
Validates if a name is valid for the filesystem

@param {string} name - The name to validate
@returns {boolean} - True if the name is valid, false otherwise