@@ -79,13 +79,14 @@ export class IndexEntry {
79
79
orderedDocumentKey : Uint8Array ,
80
80
documentKey : DocumentKey
81
81
) : DbIndexEntryKey {
82
+ const entry = this . dbIndexEntry ( uid , orderedDocumentKey , documentKey ) ;
82
83
return [
83
- this . _indexId ,
84
- uid ,
85
- encodeKeySafeBytes ( this . _arrayValue ) ,
86
- encodeKeySafeBytes ( this . _directionalValue ) ,
87
- encodeKeySafeBytes ( orderedDocumentKey ) ,
88
- documentKey . path . toArray ( )
84
+ entry . indexId ,
85
+ entry . uid ,
86
+ entry . arrayValue ,
87
+ entry . directionalValue ,
88
+ entry . orderedDocumentKey ,
89
+ entry . documentKey
89
90
] ;
90
91
}
91
92
}
@@ -130,15 +131,15 @@ export function compareByteArrays(left: Uint8Array, right: Uint8Array): number {
130
131
* Otherwise, the input array will be returned in its original type.
131
132
*/
132
133
export function encodeKeySafeBytes ( array : Uint8Array ) : KeySafeBytes {
133
- if ( isSafariOrWebkit ( ) && ! Array . isArray ( array ) ) {
134
+ if ( isSafariOrWebkit ( ) ) {
134
135
return encodeUint8ArrayToSortableString ( array ) ;
135
136
}
136
137
return array ;
137
138
}
138
139
139
140
/**
140
141
* Reverts the key safe representation of Uint8Array (created by
141
- * indexSafeUint8Array ) to a normal Uint8Array.
142
+ * encodeKeySafeBytes ) to a normal Uint8Array.
142
143
*/
143
144
export function decodeKeySafeBytes ( input : KeySafeBytes ) : Uint8Array {
144
145
if ( typeof input !== 'string' ) {
0 commit comments