Skip to content

Commit

Permalink
Revert "Update CRT (#522)" (#526)
Browse files Browse the repository at this point in the history
This reverts commit cb9dd6b.
  • Loading branch information
sfod authored Sep 5, 2024
1 parent 383e8b4 commit f08b7df
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 277 deletions.
37 changes: 0 additions & 37 deletions lib/eventstream_rpc_utils.spec.ts

This file was deleted.

10 changes: 1 addition & 9 deletions lib/eventstream_rpc_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ import {CrtError, eventstream} from "aws-crt";
* @return a base64-encoded string
*/
export function encodePayloadAsString(payload : eventstream.Payload) : string {
if (ArrayBuffer.isView(payload)) {
return Buffer.from(payload.buffer, payload.byteOffset, payload.byteLength).toString("base64");
} else if (typeof payload === "string") {
let value = payload as string;
return Buffer.from(value).toString("base64");
} else {
let value = payload as ArrayBuffer;
return Buffer.from(value).toString("base64");
}
return Buffer.from(payload).toString("base64");
}

/**
Expand Down
Loading

0 comments on commit f08b7df

Please sign in to comment.