(path = this.getCurrentPath(), isRelative)
| 39 | } |
| 40 | |
| 41 | getFile(path = this.getCurrentPath(), isRelative) { |
| 42 | const { config } = this; |
| 43 | const base = this.getBasePath(); |
| 44 | const ext = typeof config.ext === 'string' ? config.ext : '.md'; |
| 45 | |
| 46 | path = config.alias ? getAlias(path, config.alias) : path; |
| 47 | path = getFileName(path, ext); |
| 48 | path = path === `/README${ext}` ? config.homepage || path : path; |
| 49 | path = isAbsolutePath(path) ? path : getPath(base, path); |
| 50 | |
| 51 | if (isRelative) { |
| 52 | path = path.replace(new RegExp(`^${base}`), ''); |
| 53 | } |
| 54 | |
| 55 | return path; |
| 56 | } |
| 57 | |
| 58 | onchange(cb = noop) { |
| 59 | cb(); |
no test coverage detected