You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. const blacklist = [
  3. // # All
  4. '^npm-debug\\.log$', // Error log for npm
  5. '^\\..*\\.swp$', // Swap file for vim state
  6. // # macOS
  7. '^\\.DS_Store$', // Stores custom folder attributes
  8. '^\\.AppleDouble$', // Stores additional file resources
  9. '^\\.LSOverride$', // Contains the absolute path to the app to be used
  10. '^Icon\\r$', // Custom Finder icon: http://superuser.com/questions/298785/icon-file-on-os-x-desktop
  11. '^\\._.*', // Thumbnail
  12. '^\\.Spotlight-V100(?:$|\\/)', // Directory that might appear on external disk
  13. '\\.Trashes', // File that might appear on external disk
  14. '^__MACOSX$', // Resource fork
  15. // # Linux
  16. '~$', // Backup file
  17. // # Windows
  18. '^Thumbs\\.db$', // Image file cache
  19. '^ehthumbs\\.db$', // Folder config file
  20. '^Desktop\\.ini$', // Stores custom folder attributes
  21. '@eaDir$' // Synology Diskstation "hidden" folder where the server stores thumbnails
  22. ];
  23. exports.re = () => {
  24. throw new Error('`junk.re` was renamed to `junk.regex`');
  25. };
  26. exports.regex = new RegExp(blacklist.join('|'));
  27. exports.is = filename => exports.regex.test(filename);
  28. exports.not = filename => !exports.is(filename);
  29. // TODO: Remove this for the next major release
  30. exports.default = module.exports;