MCPcopy
hub / github.com/webpack/webpack / readU32

Method readU32

lib/serialization/BinaryMiddleware.js:296–307  ·  view source on GitHub ↗

* Returns u32. * @returns {number} U32

()

Source from the content-addressed store, hash-verified

294 * @returns {number} U32
295 */
296 readU32() {
297 // fast path avoids allocating a 4-byte view per length read
298 if (this.isInCurrentBuffer(I32_SIZE)) {
299 const value =
300 /** @type {Buffer} */
301 (this.currentBuffer).readUInt32LE(this.currentPosition);
302 this.currentPosition += I32_SIZE;
303 this.checkOverflow();
304 return value;
305 }
306 return this.read(I32_SIZE).readUInt32LE(0);
307 }
308
309 /**
310 * Pushes the lowest n bits of data as booleans.

Callers 1

Calls 3

isInCurrentBufferMethod · 0.95
checkOverflowMethod · 0.95
readMethod · 0.95

Tested by

no test coverage detected