mirror of https://github.com/tauri-apps/tauri
This commit is contained in:
parent
83ed090bfa
commit
fbe76a955a
|
@ -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,7 +20,11 @@
|
|||
let o = {}
|
||||
val.forEach((v, k) => (o[k] = v))
|
||||
return o
|
||||
} else if (
|
||||
} 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 &&
|
||||
typeof val.id === 'number'
|
||||
|
|
|
@ -102,13 +102,9 @@ 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
|
||||
: image instanceof Image
|
||||
? image.rid
|
||||
: image
|
||||
|
||||
return ret as T
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue