Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/jsonify/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function serializeInner(
} else if (value instanceof RegExp) {
str += `["RegExp",${JSON.stringify(value.source)}, "${value.flags}"]`;
} else if (value instanceof Uint8Array) {
str += `["Uint8Array","${b64encode(value)}"]`;
str += `["Uint8Array","${b64encode(value.buffer)}"]`;
} else if (value instanceof Set) {
const items = new Array(value.size);
let i = 0;
Expand Down Expand Up @@ -161,7 +161,7 @@ const base64abc = [
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
* Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
*/
export function b64encode(buffer: ArrayBuffer): string {
export function b64encode(buffer: ArrayBufferLike): string {
const uint8 = new Uint8Array(buffer);
let result = "",
i;
Expand Down
Loading