Skip to content

Commit 4d5b5cc

Browse files
committed
Address pr feedback
1 parent 26739c9 commit 4d5b5cc

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"test:browser:emulator": "karma start --targetBackend=emulator",
3737
"test:browser:nightly": "karma start --targetBackend=nightly",
3838
"test:browser:prod": "karma start --targetBackend=prod",
39-
"test:webkit:prod": "BROWSERS=WebkitHeadless karma start --targetBackend=prod --browsers=WebkitHeadless",
40-
"test:webkit:unit": "BROWSERS=WebkitHeadless karma start --unit --targetBackend=prod --browsers=WebkitHeadless",
39+
"test:webkit:prod": "BROWSERS=WebkitHeadless karma start --targetBackend=prod",
40+
"test:webkit:unit": "BROWSERS=WebkitHeadless karma start --unit --targetBackend=prod",
4141
"test:browser:prod:nameddb": "karma start --targetBackend=prod --databaseId=test-db",
4242
"test:browser:unit": "karma start --unit",
4343
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",

packages/firestore/src/index/index_entry.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
132133
export 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
*/
143144
export function decodeKeySafeBytes(input: KeySafeBytes): Uint8Array {
144145
if (typeof input !== 'string') {

0 commit comments

Comments
 (0)