MCPcopy Create free account
hub / github.com/angular/dev-infra / consume

Method consume

github-actions/bazel/configure-remote/configure-remote.js:18004–18033  ·  view source on GitHub ↗

* Take n bytes from the buffered Buffers * @param {number} n * @returns {Buffer}

(n)

Source from the content-addressed store, hash-verified

18002 __privateGet(this, _info).payloadLength = payloadLength;
18003 __privateSet(this, _state, parserStates.READ_DATA);
18004 if (!__privateMethod(this, _validatePayloadLength, validatePayloadLength_fn).call(this)) {
18005 return;
18006 }
18007 } else if (payloadLength === 126) {
18008 __privateSet(this, _state, parserStates.PAYLOADLENGTH_16);
18009 } else if (payloadLength === 127) {
18010 __privateSet(this, _state, parserStates.PAYLOADLENGTH_64);
18011 }
18012 if (isTextBinaryFrame(opcode)) {
18013 __privateGet(this, _info).binaryType = opcode;
18014 __privateGet(this, _info).compressed = rsv1 !== 0;
18015 }
18016 __privateGet(this, _info).opcode = opcode;
18017 __privateGet(this, _info).masked = masked;
18018 __privateGet(this, _info).fin = fin;
18019 __privateGet(this, _info).fragmented = fragmented;
18020 } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_16) {
18021 if (__privateGet(this, _byteOffset) < 2) {
18022 return callback();
18023 }
18024 const buffer = this.consume(2);
18025 __privateGet(this, _info).payloadLength = buffer.readUInt16BE(0);
18026 __privateSet(this, _state, parserStates.READ_DATA);
18027 if (!__privateMethod(this, _validatePayloadLength, validatePayloadLength_fn).call(this)) {
18028 return;
18029 }
18030 } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_64) {
18031 if (__privateGet(this, _byteOffset) < 8) {
18032 return callback();
18033 }
18034 const buffer = this.consume(8);
18035 const upper = buffer.readUInt32BE(0);
18036 const lower = buffer.readUInt32BE(4);

Callers 1

runMethod · 0.45

Calls 4

__privateGetFunction · 0.70
__privateSetFunction · 0.70
shiftMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected