Skip to content

Commit

Permalink
fix: use generic ArrayBufferView instead of Uint8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
Niraj-Kamdar committed Jun 28, 2022
1 parent 021e9cb commit 08926c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/js/client/src/plugin/PluginWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class PluginWrapper extends Wrapper {
await this._sanitizeAndLoadEnv(client, module);

let jsArgs: Record<string, unknown>;
if (args instanceof ArrayBuffer || args instanceof Uint8Array) {
if (args instanceof ArrayBuffer || ArrayBuffer.isView(args)) {
const result = msgpackDecode(args);

Tracer.addEvent("msgpack-decoded", result);
Expand Down
2 changes: 1 addition & 1 deletion packages/js/core/src/types/Invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface InvokeOptions<
* Arguments for the method, structured as a map,
* removing the chance of incorrectly ordering arguments.
*/
args?: Record<string, unknown> | Uint8Array | ArrayBuffer;
args?: Record<string, unknown> | ArrayBufferView | ArrayBuffer;

/**
* If set to true, the invoke function will not decode the msgpack results
Expand Down

0 comments on commit 08926c8

Please sign in to comment.