Skip to content

Commit a912a04

Browse files
goffrieConvex, Inc.
authored and
Convex, Inc.
committed
Coerce atob/btoa input to string before calling op (#37205)
GitOrigin-RevId: 36be5b3b355caf609b0eca93b1ebdd9550d7655a
1 parent b443feb commit a912a04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

npm-packages/udf-runtime/src/08_text_encoding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class TextDecoder {
108108
}
109109

110110
function atob(encoded: string): string {
111-
const { decoded, error } = performOp("atob", encoded);
111+
const { decoded, error } = performOp("atob", String(encoded));
112112
if (error) {
113113
throw new DOMException(
114114
`Failed to execute 'atob': ${error}`,
@@ -119,7 +119,7 @@ function atob(encoded: string): string {
119119
}
120120

121121
function btoa(text: string): string {
122-
const { encoded, error } = performOp("btoa", text);
122+
const { encoded, error } = performOp("btoa", String(text));
123123
if (error) {
124124
throw new DOMException(
125125
`Failed to execute 'btoa': ${error}`,

0 commit comments

Comments
 (0)