@hue-run/sdk 0.2.1 → 0.2.2
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/safety.js +10 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/safety.js
CHANGED
|
@@ -166,10 +166,16 @@ export function estimateRecordBytes(value, limit) {
|
|
|
166
166
|
bytes += item.byteLength;
|
|
167
167
|
else if (item && typeof item === "object" && !seen.has(item)) {
|
|
168
168
|
seen.add(item);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
// Match admission (`Snapshot.copy`): array elements are nodes without retained index
|
|
170
|
+
// keys. Charging indexes here would refuse array-heavy records the queue admitted.
|
|
171
|
+
if (Array.isArray(item))
|
|
172
|
+
for (const child of item)
|
|
173
|
+
visit(child, depth + 1);
|
|
174
|
+
else
|
|
175
|
+
for (const [key, child] of Object.entries(item)) {
|
|
176
|
+
bytes += key.length * 2 + 16;
|
|
177
|
+
visit(child, depth + 1);
|
|
178
|
+
}
|
|
173
179
|
}
|
|
174
180
|
if (bytes > limit)
|
|
175
181
|
throw new RangeError("Telemetry byte limit exceeded");
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Package version shared by the instrumentation scope and the export User-Agent. */
|
|
2
|
-
export declare const sdkVersion = "0.2.
|
|
2
|
+
export declare const sdkVersion = "0.2.2";
|
package/dist/version.js
CHANGED