Skip to content

Commit

Permalink
fix: fix js glue (#1477)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->
Fixes RVT-4225
## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Nov 26, 2024
1 parent 2ffc65b commit 496d9dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/infra/client/isolate-v8-runner/js/40_rivet_kv.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ async function put(key, value, options) {
let format = options?.format ?? "value";
let serializedValue;
if (format == "value") {
value = core.serialize(value, { forStorage: true });
serializedValue = core.serialize(value, { forStorage: true });
}
else if (format == "arrayBuffer") {
if (value instanceof ArrayBuffer)
value = new Uint8Array(value);
serializedValue = new Uint8Array(value);
else
throw new Error(`value must be of type \`ArrayBuffer\` if format is "arrayBuffer"`);
}
Expand All @@ -114,11 +114,11 @@ async function putBatch(obj, options) {
validateType(value, key, format);
let serializedValue;
if (format == "value") {
value = core.serialize(serializedValue, { forStorage: true });
serializedValue = core.serialize(value, { forStorage: true });
}
else if (format == "arrayBuffer") {
if (value instanceof ArrayBuffer)
value = new Uint8Array(value);
serializedValue = new Uint8Array(value);
else
throw new Error(`value in key "${key}" must be of type \`ArrayBuffer\` if format is "arrayBuffer"`);
}
Expand Down
10 changes: 5 additions & 5 deletions sdks/actors-bridge/src/bridge/40_rivet_kv.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/actors-bridge/src/ext/ops.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 496d9dc

Please sign in to comment.