(file)
| 216 | // 'foo/bar/baz.md' -> ['foo', 'bar', 'baz'] |
| 217 | // 'foo/bar/qux/index.md' -> ['foo', 'bar', 'qux'] |
| 218 | function getSegments(file) { |
| 219 | const locale = context.locales.find(locale => file.endsWith(`.${locale}.md`)) |
| 220 | let segments = file |
| 221 | .slice(0, (locale ? -locale.length - 1 : 0) - 3) |
| 222 | .replace(/\\/g, '/') |
| 223 | .split('/') |
| 224 | |
| 225 | if (segments[segments.length - 1] === 'index') { |
| 226 | segments.pop() |
| 227 | } |
| 228 | return [segments, locale] |
| 229 | } |
| 230 | |
| 231 | const files = await getFiles(rootDir) |
| 232 |
no outgoing calls
no test coverage detected
searching dependent graphs…