Skip to content

Commit

Permalink
fix js build
Browse files Browse the repository at this point in the history
  • Loading branch information
BasBuijsen committed Jun 18, 2024
1 parent d58aa9e commit 72fbd4a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ internal actual data class NativeHttpsCallableReference(val js: HttpsCallable) {
actual suspend fun invoke(): HttpsCallableResult = rethrow { HttpsCallableResult(js().await()) }
}

@PublishedApi
internal val HttpsCallable.native get() = NativeHttpsCallableReference(this)

internal val HttpsCallableReference.js: HttpsCallable get() = native.js
val HttpsCallableReference.js: HttpsCallable get() = native.js

actual class HttpsCallableResult(val js: JsHttpsCallableResult) {

Expand Down Expand Up @@ -86,9 +87,10 @@ actual enum class FunctionsExceptionCode {
DATA_LOSS,
UNAUTHENTICATED
}

@PublishedApi
internal inline fun <T, R> T.rethrow(function: T.() -> R): R = dev.gitlive.firebase.functions.rethrow { function() }

@PublishedApi
internal inline fun <R> rethrow(function: () -> R): R {
try {
return function()
Expand All @@ -99,6 +101,7 @@ internal inline fun <R> rethrow(function: () -> R): R {
}
}

@PublishedApi
internal fun errorToException(e: dynamic) = (e?.code ?: e?.message ?: "")
.toString()
.lowercase()
Expand Down

0 comments on commit 72fbd4a

Please sign in to comment.