octane 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const version = "0.3.
|
|
24
|
+
const version = "0.3.5";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
|
@@ -14,6 +14,7 @@ class StreamedReceiverError extends Error {
|
|
|
14
14
|
function retainCompletedResult(result) {
|
|
15
15
|
if (result.frames.at(-1)?.kind === "complete" && result.consumer?.retainCompleted?.(result.frames) === true) {
|
|
16
16
|
result.frames = [];
|
|
17
|
+
result.frameSizes.length = 0;
|
|
17
18
|
result.bytes = 0;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -54,6 +55,7 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
54
55
|
} catch {
|
|
55
56
|
}
|
|
56
57
|
state.result.frames.length = 0;
|
|
58
|
+
state.result.frameSizes.length = 0;
|
|
57
59
|
state.result.bytes = 0;
|
|
58
60
|
}
|
|
59
61
|
if (state.result.timer !== void 0) clearTimeout(state.result.timer);
|
|
@@ -96,7 +98,15 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
96
98
|
}
|
|
97
99
|
const state = {
|
|
98
100
|
identity,
|
|
99
|
-
result: {
|
|
101
|
+
result: {
|
|
102
|
+
sequence: 0,
|
|
103
|
+
opened: false,
|
|
104
|
+
values: 0,
|
|
105
|
+
terminal: false,
|
|
106
|
+
frames: [],
|
|
107
|
+
frameSizes: [],
|
|
108
|
+
bytes: 0
|
|
109
|
+
},
|
|
100
110
|
placementSequence: 0,
|
|
101
111
|
contentRevision
|
|
102
112
|
};
|
|
@@ -128,10 +138,11 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
128
138
|
if (accepted === state.result.frames.length) state.result.bytes = 0;
|
|
129
139
|
else {
|
|
130
140
|
for (let index = 0; index < accepted; index++) {
|
|
131
|
-
state.result.bytes -=
|
|
141
|
+
state.result.bytes -= state.result.frameSizes[index];
|
|
132
142
|
}
|
|
133
143
|
}
|
|
134
144
|
state.result.frames.splice(0, accepted);
|
|
145
|
+
state.result.frameSizes.splice(0, accepted);
|
|
135
146
|
}
|
|
136
147
|
retainCompletedResult(state.result);
|
|
137
148
|
return () => {
|
|
@@ -174,6 +185,7 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
174
185
|
throw new StreamedReceiverError("overflow", "Streamed result mailbox exceeded its bound.");
|
|
175
186
|
}
|
|
176
187
|
result.frames.push(frame);
|
|
188
|
+
result.frameSizes.push(bytes);
|
|
177
189
|
result.bytes += bytes;
|
|
178
190
|
}
|
|
179
191
|
if (frame.kind === "complete" || frame.kind === "error") {
|
package/dist/version.js
CHANGED