Skip to content

Commit 3fef759

Browse files
committed
✨(y-provider) create utils function toBase64
Add utility function to convert BitArray to Base64 string. This is required for creating Base64-encoded documents, as the frontend do.
1 parent 1904290 commit 3fef759

File tree

1 file changed

+4
-0
lines changed
  • src/frontend/servers/y-provider/src

1 file changed

+4
-0
lines changed

src/frontend/servers/y-provider/src/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ export function logger(...args: any[]) {
77
console.log(...args);
88
}
99
}
10+
11+
export const toBase64 = function (str: Uint8Array) {
12+
return Buffer.from(str).toString('base64');
13+
};

0 commit comments

Comments
 (0)