@firebase/firestore 4.7.5 → 4.7.6-canary.144bc3709
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firestore/src/global_index.d.ts +8 -0
- package/dist/firestore/src/model/path.d.ts +8 -0
- package/dist/index.cjs.js +219 -197
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +219 -197
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +48 -13
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +48 -13
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +317 -295
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +8 -0
- package/dist/lite/firestore/src/model/path.d.ts +8 -0
- package/dist/lite/index.browser.esm2017.js +193 -176
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.cjs.js +193 -176
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +41 -12
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +41 -12
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +181 -163
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +8 -0
- package/dist/lite/private.d.ts +8 -0
- package/dist/packages/firestore/src/model/path.d.ts +8 -0
- package/dist/private.d.ts +8 -0
- package/package.json +9 -9
package/dist/lite/index.node.mjs
CHANGED
|
@@ -3,9 +3,10 @@ import { Component } from '@firebase/component';
|
|
|
3
3
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
4
4
|
import { inspect } from 'util';
|
|
5
5
|
import { FirebaseError, getDefaultEmulatorHostnameAndPort, createMockUserToken, getModularInstance, deepEqual } from '@firebase/util';
|
|
6
|
+
import { Integer } from '@firebase/webchannel-wrapper/bloom-blob';
|
|
6
7
|
import { randomBytes as randomBytes$1 } from 'crypto';
|
|
7
8
|
|
|
8
|
-
const version$1 = "4.7.
|
|
9
|
+
const version$1 = "4.7.6-canary.144bc3709";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @license
|
|
@@ -58,7 +59,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
|
|
|
58
59
|
User.FIRST_PARTY = new User('first-party-uid');
|
|
59
60
|
User.MOCK_USER = new User('mock-user');
|
|
60
61
|
|
|
61
|
-
const version = "11.0.
|
|
62
|
+
const version = "11.2.0-canary.144bc3709";
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
65
|
* @license
|
|
@@ -800,25 +801,53 @@ class BasePath {
|
|
|
800
801
|
toArray() {
|
|
801
802
|
return this.segments.slice(this.offset, this.limit());
|
|
802
803
|
}
|
|
804
|
+
/**
|
|
805
|
+
* Compare 2 paths segment by segment, prioritizing numeric IDs
|
|
806
|
+
* (e.g., "__id123__") in numeric ascending order, followed by string
|
|
807
|
+
* segments in lexicographical order.
|
|
808
|
+
*/
|
|
803
809
|
static comparator(p1, p2) {
|
|
804
810
|
const len = Math.min(p1.length, p2.length);
|
|
805
811
|
for (let i = 0; i < len; i++) {
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
return -1;
|
|
810
|
-
}
|
|
811
|
-
if (left > right) {
|
|
812
|
-
return 1;
|
|
812
|
+
const comparison = BasePath.compareSegments(p1.get(i), p2.get(i));
|
|
813
|
+
if (comparison !== 0) {
|
|
814
|
+
return comparison;
|
|
813
815
|
}
|
|
814
816
|
}
|
|
815
|
-
|
|
817
|
+
return Math.sign(p1.length - p2.length);
|
|
818
|
+
}
|
|
819
|
+
static compareSegments(lhs, rhs) {
|
|
820
|
+
const isLhsNumeric = BasePath.isNumericId(lhs);
|
|
821
|
+
const isRhsNumeric = BasePath.isNumericId(rhs);
|
|
822
|
+
if (isLhsNumeric && !isRhsNumeric) {
|
|
823
|
+
// Only lhs is numeric
|
|
816
824
|
return -1;
|
|
817
825
|
}
|
|
818
|
-
if (
|
|
826
|
+
else if (!isLhsNumeric && isRhsNumeric) {
|
|
827
|
+
// Only rhs is numeric
|
|
819
828
|
return 1;
|
|
820
829
|
}
|
|
821
|
-
|
|
830
|
+
else if (isLhsNumeric && isRhsNumeric) {
|
|
831
|
+
// both numeric
|
|
832
|
+
return BasePath.extractNumericId(lhs).compare(BasePath.extractNumericId(rhs));
|
|
833
|
+
}
|
|
834
|
+
else {
|
|
835
|
+
// both non-numeric
|
|
836
|
+
if (lhs < rhs) {
|
|
837
|
+
return -1;
|
|
838
|
+
}
|
|
839
|
+
if (lhs > rhs) {
|
|
840
|
+
return 1;
|
|
841
|
+
}
|
|
842
|
+
return 0;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
// Checks if a segment is a numeric ID (starts with "__id" and ends with "__").
|
|
846
|
+
static isNumericId(segment) {
|
|
847
|
+
return segment.startsWith('__id') && segment.endsWith('__');
|
|
848
|
+
}
|
|
849
|
+
static extractNumericId(segment) {
|
|
850
|
+
return Integer.fromString(segment.substring(4, segment.length - 2));
|
|
822
851
|
}
|
|
823
852
|
}
|
|
824
853
|
/**
|