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