Skip to main content

Practice ยท 3 of 3

Gitignore Guard

Write ignoreCovers(gitignoreLines, filePath): return true when any non-comment, non-empty pattern covers the path. Support: exact name (".env"), prefix glob (".env*"), directory prefix ("config/" covers "config/local.json" but NOT "config-local.json"), and wildcard ("*.log" covers "a.log", "b/c.log").

Difficulty: intermediate

Back to lesson: Practice: Secret Detection โ€” Practice