Compile an ignore file (similar to .gitignore) to a Javascript function