2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ import dev.gitlive.firebase.externals.FirebaseApp
8
8
import kotlin.js.Json
9
9
import kotlin.js.Promise
10
10
11
+ external fun documentId (): FieldPath
12
+
11
13
external class FieldPath (vararg fieldNames : String ) {
12
- companion object {
13
- val documentId: FieldPath
14
- }
15
14
fun isEqual (other : FieldPath ): Boolean
16
15
17
16
}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import dev.gitlive.firebase.firestore.externals.clearIndexedDbPersistence
15
15
import dev.gitlive.firebase.firestore.externals.connectFirestoreEmulator
16
16
import dev.gitlive.firebase.firestore.externals.deleteDoc
17
17
import dev.gitlive.firebase.firestore.externals.doc
18
+ import dev.gitlive.firebase.firestore.externals.documentId as jsDocumentId
18
19
import dev.gitlive.firebase.firestore.externals.enableIndexedDbPersistence
19
20
import dev.gitlive.firebase.firestore.externals.getDoc
20
21
import dev.gitlive.firebase.firestore.externals.getDocs
@@ -440,10 +441,10 @@ actual class SnapshotMetadata(val js: JsSnapshotMetadata) {
440
441
actual class FieldPath private constructor(val js : JsFieldPath ) {
441
442
442
443
actual companion object {
443
- actual val documentId = FieldPath (JsFieldPath .documentId )
444
+ actual val documentId = FieldPath (jsDocumentId() )
444
445
}
445
446
actual constructor (vararg fieldNames: String ) : this (dev.gitlive.firebase.firestore.rethrow {
446
- js( " Reflect " ).construct( JsFieldPath , fieldNames).unsafeCast< JsFieldPath >( )
447
+ JsFieldPath ( * fieldNames )
447
448
})
448
449
actual val documentId: FieldPath get() = FieldPath .documentId
449
450
actual val encoded: EncodedFieldPath = js
0 commit comments