(root, cwd, exclude = [])
| 33 | * @returns {Promise<Array<string>>} a promise containing an array of paths |
| 34 | */ |
| 35 | export const getMarkdownFiles = async (root, cwd, exclude = []) => { |
| 36 | const cacheKey = `${root}${cwd}${exclude.join('')}`; |
| 37 | |
| 38 | if (!globCacheByPath.has(cacheKey)) { |
| 39 | const result = Array.fromAsync( |
| 40 | glob('**/*.{md,mdx}', { root, cwd, exclude }) |
| 41 | ); |
| 42 | |
| 43 | globCacheByPath.set(cacheKey, result); |
| 44 | } |
| 45 | |
| 46 | return globCacheByPath.get(cacheKey); |
| 47 | }; |
no outgoing calls
no test coverage detected