MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / EnqueueValueWithSize

Function EnqueueValueWithSize

examples/io/streams/modules/streams.js:3234–3241  ·  view source on GitHub ↗
(container, value, size)

Source from the content-addressed store, hash-verified

3232 return valueWithSize.value;
3233}
3234function EnqueueValueWithSize(container, value, size) {
3235 if (!IsNonNegativeNumber(size))
3236 throw new RangeError("invalid size");
3237 if (size == Number.POSITIVE_INFINITY)
3238 throw new RangeError("invalid size");
3239 container.queue.push({ value, size });
3240 container.queueTotalSize += size;
3241}
3242function PeekQueueValue(container) {
3243 assert(container.queue.length > 0);
3244 let valueWithSize = container.queue[0];

Calls 2

IsNonNegativeNumberFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected