(path, cache = true, cacheOnly = false)
| 82 | } |
| 83 | |
| 84 | async function get(path, cache = true, cacheOnly = false) |
| 85 | { |
| 86 | const _readPages = await readPages(path); |
| 87 | const totalPages = await countPages(path, cache, cacheOnly); |
| 88 | |
| 89 | let percent = (totalPages === 1) ? 0 : ((((_readPages || 1) - 1) / (totalPages - 1)) * 100); |
| 90 | if(percent > 100) percent = 100; |
| 91 | |
| 92 | return { |
| 93 | read: _readPages, |
| 94 | total: totalPages, |
| 95 | percent: percent, |
| 96 | percentRound: Math.round(percent), |
| 97 | completed: (_readPages >= totalPages), |
| 98 | }; |
| 99 | } |
| 100 | |
| 101 | async function simpleGet(path, cache = true, cacheOnly = false) |
| 102 | { |
no test coverage detected