(base: string, path: string | null | undefined)
| 6 | import { getPreloadPaths } from './preload-strategy'; |
| 7 | |
| 8 | const simplifyPath = (base: string, path: string | null | undefined) => { |
| 9 | if (path == null) { |
| 10 | return null; |
| 11 | } |
| 12 | const segments = `${base}${path}`.split('/'); |
| 13 | const simplified = []; |
| 14 | for (const segment of segments) { |
| 15 | if (segment === '..' && simplified.length > 0) { |
| 16 | simplified.pop(); |
| 17 | } else { |
| 18 | simplified.push(segment); |
| 19 | } |
| 20 | } |
| 21 | return simplified.join('/'); |
| 22 | }; |
| 23 | |
| 24 | export const preloaderPre = ( |
| 25 | base: string, |
no test coverage detected
searching dependent graphs…