@@ -79,13 +79,14 @@ export class IndexEntry {
7979 orderedDocumentKey : Uint8Array ,
8080 documentKey : DocumentKey
8181 ) : DbIndexEntryKey {
82+ const entry = this . dbIndexEntry ( uid , orderedDocumentKey , documentKey ) ;
8283 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
8990 ] ;
9091 }
9192}
@@ -130,15 +131,15 @@ export function compareByteArrays(left: Uint8Array, right: Uint8Array): number {
130131 * Otherwise, the input array will be returned in its original type.
131132 */
132133export function encodeKeySafeBytes ( array : Uint8Array ) : KeySafeBytes {
133- if ( isSafariOrWebkit ( ) && ! Array . isArray ( array ) ) {
134+ if ( isSafariOrWebkit ( ) ) {
134135 return encodeUint8ArrayToSortableString ( array ) ;
135136 }
136137 return array ;
137138}
138139
139140/**
140141 * Reverts the key safe representation of Uint8Array (created by
141- * indexSafeUint8Array ) to a normal Uint8Array.
142+ * encodeKeySafeBytes ) to a normal Uint8Array.
142143 */
143144export function decodeKeySafeBytes ( input : KeySafeBytes ) : Uint8Array {
144145 if ( typeof input !== 'string' ) {
0 commit comments