@squidcloud/client 1.0.176 → 1.0.177
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/cjs/index.js
CHANGED
|
@@ -29395,12 +29395,14 @@ function replaceKeyInRecord(record, a, b) {
|
|
|
29395
29395
|
delete record[a];
|
|
29396
29396
|
}
|
|
29397
29397
|
}
|
|
29398
|
+
function isNil(obj) {
|
|
29399
|
+
return obj === undefined || obj === null;
|
|
29400
|
+
}
|
|
29398
29401
|
|
|
29399
29402
|
;// CONCATENATED MODULE: ../internal-common/src/public-types/pagination.public-types.ts
|
|
29400
29403
|
|
|
29401
29404
|
|
|
29402
29405
|
|
|
29403
|
-
|
|
29404
29406
|
class Pagination {
|
|
29405
29407
|
/** @internal */
|
|
29406
29408
|
constructor(snapshotEmitter, options = {}) {
|
|
@@ -29446,10 +29448,10 @@ class Pagination {
|
|
|
29446
29448
|
this.snapshotSubject.next(firstPageSnapshot);
|
|
29447
29449
|
}
|
|
29448
29450
|
static compareValues(a, b) {
|
|
29449
|
-
if (
|
|
29450
|
-
return
|
|
29451
|
+
if (isNil(a)) {
|
|
29452
|
+
return isNil(b) ? 0 : -1;
|
|
29451
29453
|
}
|
|
29452
|
-
if (
|
|
29454
|
+
if (isNil(b)) {
|
|
29453
29455
|
return 1;
|
|
29454
29456
|
}
|
|
29455
29457
|
if (a > b) {
|
|
@@ -29463,7 +29465,7 @@ class Pagination {
|
|
|
29463
29465
|
}
|
|
29464
29466
|
}
|
|
29465
29467
|
compare(doc1, doc2) {
|
|
29466
|
-
if (
|
|
29468
|
+
if (isNil(doc2)) {
|
|
29467
29469
|
return 1;
|
|
29468
29470
|
}
|
|
29469
29471
|
for (const so of this.templateSnapshotEmitter.getSortOrders()) {
|
|
@@ -29742,6 +29744,7 @@ function decodeValueForMapping(encodedString) {
|
|
|
29742
29744
|
;// CONCATENATED MODULE: ../internal-common/src/types/query.types.ts
|
|
29743
29745
|
|
|
29744
29746
|
|
|
29747
|
+
|
|
29745
29748
|
/**
|
|
29746
29749
|
* Example query mapping:
|
|
29747
29750
|
* Queries:
|
|
@@ -29780,30 +29783,30 @@ function compareOperator(conditionValue, valueInDocument, operator) {
|
|
|
29780
29783
|
// Nulls can only be compared for (in)equality, not other operators.
|
|
29781
29784
|
switch (operator) {
|
|
29782
29785
|
case '<':
|
|
29783
|
-
if (
|
|
29786
|
+
if (isNil(conditionValue))
|
|
29784
29787
|
return false;
|
|
29785
|
-
if (
|
|
29788
|
+
if (isNil(valueInDocument))
|
|
29786
29789
|
return true;
|
|
29787
29790
|
return valueInDocument < conditionValue;
|
|
29788
29791
|
case '<=':
|
|
29789
|
-
if (
|
|
29792
|
+
if (isNil(valueInDocument)) {
|
|
29790
29793
|
return true;
|
|
29791
29794
|
}
|
|
29792
|
-
if (
|
|
29795
|
+
if (isNil(conditionValue)) {
|
|
29793
29796
|
return false;
|
|
29794
29797
|
}
|
|
29795
29798
|
return valueInDocument <= conditionValue;
|
|
29796
29799
|
case '>':
|
|
29797
|
-
if (
|
|
29800
|
+
if (isNil(valueInDocument))
|
|
29798
29801
|
return false;
|
|
29799
|
-
if (
|
|
29802
|
+
if (isNil(conditionValue))
|
|
29800
29803
|
return true;
|
|
29801
29804
|
return valueInDocument > conditionValue;
|
|
29802
29805
|
case '>=':
|
|
29803
|
-
if (
|
|
29806
|
+
if (isNil(conditionValue)) {
|
|
29804
29807
|
return true;
|
|
29805
29808
|
}
|
|
29806
|
-
if (
|
|
29809
|
+
if (isNil(valueInDocument)) {
|
|
29807
29810
|
return false;
|
|
29808
29811
|
}
|
|
29809
29812
|
return valueInDocument >= conditionValue;
|
|
@@ -49149,10 +49152,10 @@ class DocumentStore {
|
|
|
49149
49152
|
return this.squidDocIdToDoc.get(squidDocId);
|
|
49150
49153
|
}
|
|
49151
49154
|
compareValues(a, b) {
|
|
49152
|
-
if (
|
|
49153
|
-
return
|
|
49155
|
+
if (isNil(a)) {
|
|
49156
|
+
return isNil(b) ? 0 : -1;
|
|
49154
49157
|
}
|
|
49155
|
-
if (
|
|
49158
|
+
if (isNil(b))
|
|
49156
49159
|
return 1;
|
|
49157
49160
|
if (a === b)
|
|
49158
49161
|
return 0;
|
|
@@ -3,3 +3,4 @@ export declare function setInPath(obj: object, path: string, value: unknown, del
|
|
|
3
3
|
export declare function deleteInPath(obj: object, path: string, delimiter?: string): void;
|
|
4
4
|
export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
|
|
5
5
|
export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
|
|
6
|
+
export declare function isNil(obj: unknown): obj is null | undefined;
|