@shaxpir/duiduidui-models 1.28.0 → 1.29.0
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.
|
@@ -12,7 +12,7 @@ import { Conditions } from './Condition';
|
|
|
12
12
|
export interface SearchState {
|
|
13
13
|
query?: string;
|
|
14
14
|
senseRank?: number;
|
|
15
|
-
|
|
15
|
+
entryId?: string;
|
|
16
16
|
conditions?: Conditions;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -46,6 +46,6 @@ export declare function createEmptySearchHistory(): SearchHistory;
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function areSearchStatesEqual(a: SearchState | undefined, b: SearchState | undefined): boolean;
|
|
48
48
|
/**
|
|
49
|
-
* Checks if a SearchState is empty (no query, no
|
|
49
|
+
* Checks if a SearchState is empty (no query, no entryId, no conditions).
|
|
50
50
|
*/
|
|
51
51
|
export declare function isEmptySearchState(state: SearchState | undefined): boolean;
|
|
@@ -35,8 +35,8 @@ function areSearchStatesEqual(a, b) {
|
|
|
35
35
|
// Compare senseRank
|
|
36
36
|
if (a.senseRank !== b.senseRank)
|
|
37
37
|
return false;
|
|
38
|
-
// Compare
|
|
39
|
-
if (a.
|
|
38
|
+
// Compare entryId
|
|
39
|
+
if (a.entryId !== b.entryId)
|
|
40
40
|
return false;
|
|
41
41
|
// Compare conditions using JSON serialization (with sorted keys for consistency)
|
|
42
42
|
const conditionsA = a.conditions ? JSON.stringify(sortConditions(a.conditions)) : undefined;
|
|
@@ -62,13 +62,13 @@ function sortConditions(conditions) {
|
|
|
62
62
|
return sorted;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Checks if a SearchState is empty (no query, no
|
|
65
|
+
* Checks if a SearchState is empty (no query, no entryId, no conditions).
|
|
66
66
|
*/
|
|
67
67
|
function isEmptySearchState(state) {
|
|
68
68
|
if (!state)
|
|
69
69
|
return true;
|
|
70
70
|
return !state.query?.trim() &&
|
|
71
|
-
!state.
|
|
71
|
+
!state.entryId &&
|
|
72
72
|
!state.conditions?.any?.length &&
|
|
73
73
|
!state.conditions?.all?.length &&
|
|
74
74
|
!state.conditions?.none?.length;
|
package/dist/models/Term.d.ts
CHANGED