mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-24 12:14:05 +03:00
This commit is contained in:
parent
83ed090bfa
commit
fbe76a955a
6
.changes/serialize-array-buffer.md
Normal file
6
.changes/serialize-array-buffer.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri": patch:bug
|
||||
"@tauri-apps/api": patch:bug
|
||||
---
|
||||
|
||||
Uint8Arrays and ArrayBuffers are now properly serialized as an array of numbers.
|
File diff suppressed because one or more lines are too long
@ -20,6 +20,10 @@
|
||||
let o = {}
|
||||
val.forEach((v, k) => (o[k] = v))
|
||||
return o
|
||||
} else if (val instanceof Uint8Array) {
|
||||
return Array.from(val)
|
||||
} else if (val instanceof ArrayBuffer) {
|
||||
return Array.from(new Uint8Array(val))
|
||||
} else if (
|
||||
val instanceof Object &&
|
||||
'__TAURI_CHANNEL_MARKER__' in val &&
|
||||
|
@ -102,10 +102,6 @@ export function transformImage<T>(
|
||||
? null
|
||||
: typeof image === 'string'
|
||||
? image
|
||||
: image instanceof Uint8Array
|
||||
? Array.from(image)
|
||||
: image instanceof ArrayBuffer
|
||||
? Array.from(new Uint8Array(image))
|
||||
: image instanceof Image
|
||||
? image.rid
|
||||
: image
|
||||
|
Loading…
Reference in New Issue
Block a user