@openstax/ts-utils 1.27.4 → 1.27.6
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/services/searchProvider/index.d.ts +5 -4
- package/dist/cjs/services/searchProvider/memorySearchTheBadWay.js +2 -0
- package/dist/cjs/tsconfig.without-specs.cjs.tsbuildinfo +1 -1
- package/dist/esm/services/searchProvider/index.d.ts +5 -4
- package/dist/esm/services/searchProvider/memorySearchTheBadWay.js +2 -0
- package/dist/esm/tsconfig.without-specs.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare type FieldType = string | string[] | number | boolean;
|
|
2
2
|
export declare type ESFilter = {
|
|
3
3
|
terms: Record<string, FieldType>;
|
|
4
|
+
} | {
|
|
5
|
+
term: Record<string, FieldType>;
|
|
4
6
|
} | {
|
|
5
7
|
exists: {
|
|
6
8
|
field: string;
|
|
@@ -31,10 +33,6 @@ declare type Field = {
|
|
|
31
33
|
} | {
|
|
32
34
|
key: string;
|
|
33
35
|
type: 'keyword';
|
|
34
|
-
} | {
|
|
35
|
-
key: string;
|
|
36
|
-
type: 'date';
|
|
37
|
-
format?: string;
|
|
38
36
|
} | {
|
|
39
37
|
key: string;
|
|
40
38
|
type: 'boolean';
|
|
@@ -45,6 +43,9 @@ export interface IndexOptions<T> {
|
|
|
45
43
|
}
|
|
46
44
|
export declare type FieldMapping = {
|
|
47
45
|
type: 'keyword' | 'text' | 'boolean';
|
|
46
|
+
} | {
|
|
47
|
+
type: 'date';
|
|
48
|
+
format?: string;
|
|
48
49
|
} | {
|
|
49
50
|
type?: 'nested' | 'object';
|
|
50
51
|
properties: Record<string, FieldMapping>;
|
|
@@ -84,6 +84,8 @@ const matchClause = (context, clause) => {
|
|
|
84
84
|
: clause;
|
|
85
85
|
if ('terms' in filter)
|
|
86
86
|
return matchTerms(context, filter.terms);
|
|
87
|
+
else if ('term' in filter)
|
|
88
|
+
return matchTerms(context, filter.term);
|
|
87
89
|
else if ('exists' in filter)
|
|
88
90
|
return matchExists(context, filter.exists);
|
|
89
91
|
else if ('bool' in filter)
|