Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	library/src/jsMain/kotlin/com/lightningkite/kiteui/fetch.js.kt
  • Loading branch information
UnknownJoe796 committed Aug 21, 2024
2 parents 2409839 + 256e847 commit 609e9d2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class WebSocketWrapper(val native: org.w3c.dom.WebSocket) : WebSocket {
actual fun Blob.bytes(): Long = size.toLong()
actual fun FileReference.bytes(): Long = size.toLong()

actual suspend fun Blob.text(): String = (js("this.text()") as Promise<String>).await()
actual suspend fun FileReference.text(): String = (js("this.text()") as Promise<String>).await()
fun jsTextBlob(blob: Blob) = js("blob.text()") as Promise<String>
actual suspend fun Blob.text(): String = jsTextBlob(this).await()
actual suspend fun FileReference.text(): String = jsTextBlob(this).await()
actual fun String.toBlob(contentType: String): Blob = Blob(arrayOf(this), BlobPropertyBag(type = contentType))

0 comments on commit 609e9d2

Please sign in to comment.