(config, vm)
| 153 | } |
| 154 | |
| 155 | function init$1(config, vm) { |
| 156 | var isAuto = config.paths === 'auto'; |
| 157 | var isExpired = localStorage.getItem('docsify.search.expires') < Date.now(); |
| 158 | |
| 159 | INDEXS = JSON.parse(localStorage.getItem('docsify.search.index')); |
| 160 | |
| 161 | if (isExpired) { |
| 162 | INDEXS = {}; |
| 163 | } else if (!isAuto) { |
| 164 | return |
| 165 | } |
| 166 | |
| 167 | var paths = isAuto ? getAllPaths(vm.router) : config.paths; |
| 168 | var len = paths.length; |
| 169 | var count = 0; |
| 170 | |
| 171 | paths.forEach(function (path) { |
| 172 | if (INDEXS[path]) { |
| 173 | return count++ |
| 174 | } |
| 175 | |
| 176 | Docsify |
| 177 | .get(vm.router.getFile(path), false, vm.config.requestHeaders) |
| 178 | .then(function (result) { |
| 179 | INDEXS[path] = genIndex(path, result, vm.router, config.depth); |
| 180 | len === ++count && saveData(config.maxAge); |
| 181 | }); |
| 182 | }); |
| 183 | } |
| 184 | |
| 185 | var NO_DATA_TEXT = ''; |
| 186 | var options; |
no test coverage detected