(pattern: string)
| 15 | * if available. Otherwise a new glob will be created and cached. |
| 16 | */ |
| 17 | export function getOrCreateGlob(pattern: string) { |
| 18 | if (patternCache.has(pattern)) { |
| 19 | return patternCache.get(pattern)!; |
| 20 | } |
| 21 | const glob = new Minimatch(pattern, {dot: false, nobrace: false}); |
| 22 | patternCache.set(pattern, glob); |
| 23 | return glob; |
| 24 | } |