(fn: (...args: any[]) => T)
| 22 | const fsExistsSyncCache = {} |
| 23 | |
| 24 | const memoize = <T = any>(fn: (...args: any[]) => T) => { |
| 25 | const cache = {} |
| 26 | return (...args: any[]): T => { |
| 27 | const key = JSON.stringify(args) |
| 28 | if (cache[key] === undefined) { |
| 29 | cache[key] = fn(...args) |
| 30 | } |
| 31 | return cache[key] |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | const cachedGetUrlFromPagesDirectories = memoize(getUrlFromPagesDirectories) |
| 36 | const cachedGetUrlFromAppDirectory = memoize(getUrlFromAppDirectory) |
no test coverage detected