Fixed JsUtil.kt, Uint8Array type to ByteArray

This commit is contained in:
PlaceboAddict authored and kildishevps committed 2025-01-22 23:07:02 +03:00
1 parent f161aef4ac
commit f7bb312273
1 file changed
+4 -4
@@ -8,14 +8,14 @@ import org.khronos.webgl.get
* ugljesa.jovanovic@ionspin.com
* on 02-Aug-2020
*/
fun UByteArray.toUInt8Array() : Uint8Array {
val uint8Result = Uint8Array(toByteArray().toTypedArray())
return uint8Result
fun UByteArray.toByteArray() : ByteArray {
// val uint8Result = ByteArray(toTypedArray())
return toByteArray()
}
fun Uint8Array.toUByteArray() : UByteArray {
if (length.asDynamic() == undefined) {
if (length == null) {
println("Error")
}
val result = UByteArray(length)