MCPcopy Create free account
hub / github.com/amqp-node/amqplib / beginEncodingContainer

Function beginEncodingContainer

lib/codec.js:97–104  ·  view source on GitHub ↗
(unfinishedContainers, buffer, values, offset)

Source from the content-addressed store, hash-verified

95}
96
97function beginEncodingContainer(unfinishedContainers, buffer, values, offset) {
98 checkSpace(buffer, offset, 4);
99 const isArray = Array.isArray(values);
100 const keys = isArray ? null : enumerableKeys(values);
101 const entryCount = isArray ? values.length : keys.length;
102 unfinishedContainers.push({ values, isArray, keys, entryCount, nextEntry: 0, lengthOffset: offset });
103 return offset + 4; // leave room for the length
104}
105
106function enumerableKeys(table) {
107 const keys = [];

Callers 2

encodeTableFunction · 0.85
encodeContainerFunction · 0.85

Calls 2

checkSpaceFunction · 0.85
enumerableKeysFunction · 0.85

Tested by

no test coverage detected