fix: b64encode param type (#2832)
This commit is contained in:
@@ -109,7 +109,7 @@ function serializeInner(
|
|||||||
} else if (value instanceof RegExp) {
|
} else if (value instanceof RegExp) {
|
||||||
str += `["RegExp",${JSON.stringify(value.source)}, "${value.flags}"]`;
|
str += `["RegExp",${JSON.stringify(value.source)}, "${value.flags}"]`;
|
||||||
} else if (value instanceof Uint8Array) {
|
} else if (value instanceof Uint8Array) {
|
||||||
str += `["Uint8Array","${b64encode(value)}"]`;
|
str += `["Uint8Array","${b64encode(value.buffer)}"]`;
|
||||||
} else if (value instanceof Set) {
|
} else if (value instanceof Set) {
|
||||||
const items = new Array(value.size);
|
const items = new Array(value.size);
|
||||||
let i = 0;
|
let i = 0;
|
||||||
@@ -161,7 +161,7 @@ const base64abc = [
|
|||||||
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
||||||
* Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
|
* 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);
|
const uint8 = new Uint8Array(buffer);
|
||||||
let result = "",
|
let result = "",
|
||||||
i;
|
i;
|
||||||
|
|||||||
Reference in New Issue
Block a user