const ILLEGAL_CHARACTERS = '/?<>\\:*|"'
const ILLEGAL_CHARACTERS_REGEXP = new RegExp(`[${ILLEGAL_CHARACTERS}]`, 'g')
const REPLACEMENT_CHARACTER = '_'

// Return a new name compatible with target filesystems by replacing invalid
// characters from the given file/dir name.
export function validName (name: string) {
  return name.replace(ILLEGAL_CHARACTERS_REGEXP, REPLACEMENT_CHARACTER)
}

@@ -1,28 +1,617 @@
+import logger from '../logger'%0A%0Aconst log = logger(%7B%0A  component: 'FS'%0A%7D)%0A%0A// The fswin module can only be loaded on Windows%0Alet fswin%0Aif (process.platform === 'win32') %7B%0A  fswin = require('fswin')%0A%7D%0A%0A// Hides a file or directory on Windows.%0A// Async so it doesn't block more useful operations.%0A// No failure handling because we can't / don't want to do anything anyway.%0Aexport function hideOnWindows (path: string): void %7B%0A  if (!fswin) return%0A  fswin.setAttributes(path, %7BIS_HIDDEN: true%7D, (succeeded) =%3E %7B%0A    if (!succeeded) log.warn(%60Could not set IS_HIDDEN flag on $%7Bpath%7D%60)%0A  %7D)%0A%7D%0A%0A
 const ILLEGAL_CHARACTERS = '

Introduce utils/fs.hideOnWindows()