(scriptPaths)
| 80 | |
| 81 | // given an array of scripts, return the total of their combined file sizes |
| 82 | function getScriptSizes(scriptPaths) { |
| 83 | const res = scriptPaths.reduce( |
| 84 | (acc, scriptPath) => { |
| 85 | const [rawSize, gzipSize] = getScriptSize(scriptPath) |
| 86 | acc.raw += rawSize |
| 87 | acc.gzip += gzipSize |
| 88 | |
| 89 | return acc |
| 90 | }, |
| 91 | { raw: 0, gzip: 0 } |
| 92 | ) |
| 93 | |
| 94 | return res |
| 95 | } |
| 96 | |
| 97 | // given an individual path to a script, return its file size |
| 98 | function getScriptSize(scriptPath) { |
no test coverage detected