(matcher: FileMatcher)
| 258 | const HASH_PATTERN = /\.[0-9a-z]{8,}(?=\.)/gi; |
| 259 | |
| 260 | const toMatcherFn = (matcher: FileMatcher): ((file: string) => boolean) => { |
| 261 | if (typeof matcher === 'function') { |
| 262 | return matcher; |
| 263 | } |
| 264 | if (typeof matcher === 'string') { |
| 265 | return (file: string) => file.endsWith(matcher); |
| 266 | } |
| 267 | return (file: string) => matcher.test(file); |
| 268 | }; |
| 269 | |
| 270 | /** |
| 271 | * Find the first filename that matches the matcher |