(bundle: Uint8Array)
| 157 | |
| 158 | // private method, static to emphasize pure functional character |
| 159 | private static readWebBundleLength(bundle: Uint8Array): number { |
| 160 | // The length of the web bundle is contained in the last 8 bytes of the web |
| 161 | // bundle, represented as BigEndian. |
| 162 | const buffer = Buffer.from(bundle.slice(-8)); |
| 163 | // Number is big enough to represent 4GB which is the limit for the web |
| 164 | // bundle size which can be contained in a Buffer, which is the format |
| 165 | // in which it's passed back to e.g. Webpack. |
| 166 | return Number(buffer.readBigUint64BE()); |
| 167 | } |
| 168 | } |
no outgoing calls
no test coverage detected