(vm)
| 218 | } |
| 219 | |
| 220 | function renderNameLink(vm) { |
| 221 | const el = dom.getNode('.app-name-link'); |
| 222 | const nameLink = vm.config.nameLink; |
| 223 | const path = vm.route.path; |
| 224 | |
| 225 | if (!el) { |
| 226 | return; |
| 227 | } |
| 228 | |
| 229 | if (isPrimitive(vm.config.nameLink)) { |
| 230 | el.setAttribute('href', nameLink); |
| 231 | } else if (typeof nameLink === 'object') { |
| 232 | const match = Object.keys(nameLink).filter( |
| 233 | key => path.indexOf(key) > -1 |
| 234 | )[0]; |
| 235 | |
| 236 | el.setAttribute('href', nameLink[match]); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | /** @typedef {import('../Docsify').Constructor} Constructor */ |
| 241 |
no test coverage detected
searching dependent graphs…