quetch 0.9.1 → 0.9.2

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.
@@ -1,6 +1,6 @@
1
1
  import type { Filter, FilterGroup } from "../types";
2
2
  /**
3
- * Return `true` if the provided filter `value` is a group filter or not.
3
+ * Returns `true` if the provided filter `value` is a group filter or not.
4
4
  *
5
5
  * @param value The filter to test.
6
6
  * @returns Whether the provided filter is a group filter or not.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Return `true` if the provided filter `value` is a group filter or not.
2
+ * Returns `true` if the provided filter `value` is a group filter or not.
3
3
  *
4
4
  * @param value The filter to test.
5
5
  * @returns Whether the provided filter is a group filter or not.
@@ -1,6 +1,7 @@
1
1
  import type { FilterArray } from "./FilterArray";
2
2
  import type { FilterBoolean } from "./FilterBoolean";
3
3
  import type { FilterChildren } from "./FilterChildren";
4
+ import type { FilterCustom } from "./FilterCustom";
4
5
  import type { FilterField } from "./FilterField";
5
6
  import type { FilterGroup } from "./FilterGroup";
6
7
  import type { FilterNumber } from "./FilterNumber";
@@ -10,4 +11,4 @@ import type { FilterStringMatch } from "./FilterStringMatch";
10
11
  /**
11
12
  * Describes a predicate for filtering items.
12
13
  */
13
- export type Filter<T extends object> = FilterArray<T> | FilterBoolean<T> | FilterChildren<T> | FilterField<T> | FilterNumber<T> | FilterGroup<T> | FilterString<T> | FilterStringIntersect<T> | FilterStringMatch<T>;
14
+ export type Filter<T extends object> = FilterArray<T> | FilterBoolean<T> | FilterChildren<T> | FilterCustom<T> | FilterField<T> | FilterNumber<T> | FilterGroup<T> | FilterString<T> | FilterStringIntersect<T> | FilterStringMatch<T>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Custom filter where `value(item)` returns `true` for matching items.
3
+ */
4
+ export type FilterCustom<T extends object> = {
5
+ operator: "custom";
6
+ value: (item: T) => boolean;
7
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FilterCustom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterCustom.js","sourceRoot":"","sources":["../../lib/types/FilterCustom.ts"],"names":[],"mappings":""}
package/doc/README.md CHANGED
@@ -99,7 +99,7 @@ Aggregation function.
99
99
 
100
100
  #### Defined in
101
101
 
102
- [lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/AggregateFunction.ts#L4)
102
+ [lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/AggregateFunction.ts#L4)
103
103
 
104
104
  ___
105
105
 
@@ -109,7 +109,7 @@ ___
109
109
 
110
110
  #### Defined in
111
111
 
112
- [lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/044bd59/lib/types/AggregateFunctionOperator.ts#L3)
112
+ [lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/AggregateFunctionOperator.ts#L3)
113
113
 
114
114
  ___
115
115
 
@@ -119,7 +119,7 @@ ___
119
119
 
120
120
  #### Defined in
121
121
 
122
- [lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Any.ts#L1)
122
+ [lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Any.ts#L1)
123
123
 
124
124
  ___
125
125
 
@@ -135,7 +135,7 @@ ___
135
135
 
136
136
  #### Defined in
137
137
 
138
- [lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Context.ts#L1)
138
+ [lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Context.ts#L1)
139
139
 
140
140
  ___
141
141
 
@@ -151,7 +151,7 @@ ___
151
151
 
152
152
  #### Defined in
153
153
 
154
- [lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/044bd59/lib/types/CustomFieldAggregateMap.ts#L3)
154
+ [lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/CustomFieldAggregateMap.ts#L3)
155
155
 
156
156
  ___
157
157
 
@@ -167,7 +167,7 @@ ___
167
167
 
168
168
  #### Defined in
169
169
 
170
- [lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/044bd59/lib/types/CustomFieldMap.ts#L3)
170
+ [lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/CustomFieldMap.ts#L3)
171
171
 
172
172
  ___
173
173
 
@@ -193,7 +193,7 @@ ___
193
193
 
194
194
  #### Defined in
195
195
 
196
- [lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/CustomRequest.ts#L4)
196
+ [lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/CustomRequest.ts#L4)
197
197
 
198
198
  ___
199
199
 
@@ -209,7 +209,7 @@ ___
209
209
 
210
210
  #### Defined in
211
211
 
212
- [lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FieldFunction.ts#L4)
212
+ [lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FieldFunction.ts#L4)
213
213
 
214
214
  ___
215
215
 
@@ -234,7 +234,7 @@ Applies a custom field transform function.
234
234
 
235
235
  #### Defined in
236
236
 
237
- [lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FieldFunctionCustom.ts#L4)
237
+ [lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FieldFunctionCustom.ts#L4)
238
238
 
239
239
  ___
240
240
 
@@ -260,7 +260,7 @@ Formats the date found in a given field, which can be an ISO string date or a ti
260
260
 
261
261
  #### Defined in
262
262
 
263
- [lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FieldFunctionFormatDate.ts#L6)
263
+ [lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FieldFunctionFormatDate.ts#L6)
264
264
 
265
265
  ___
266
266
 
@@ -278,13 +278,13 @@ Return types of custom field functions.
278
278
 
279
279
  #### Defined in
280
280
 
281
- [lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FieldFunctionReturn.ts#L4)
281
+ [lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FieldFunctionReturn.ts#L4)
282
282
 
283
283
  ___
284
284
 
285
285
  ### Filter
286
286
 
287
- Ƭ **Filter**<`T`\>: [`FilterArray`](README.md#filterarray)<`T`\> \| [`FilterBoolean`](README.md#filterboolean)<`T`\> \| [`FilterChildren`](README.md#filterchildren)<`T`\> \| [`FilterField`](README.md#filterfield)<`T`\> \| [`FilterNumber`](README.md#filternumber)<`T`\> \| [`FilterGroup`](README.md#filtergroup)<`T`\> \| [`FilterString`](README.md#filterstring)<`T`\> \| [`FilterStringIntersect`](README.md#filterstringintersect)<`T`\> \| [`FilterStringMatch`](README.md#filterstringmatch)<`T`\>
287
+ Ƭ **Filter**<`T`\>: [`FilterArray`](README.md#filterarray)<`T`\> \| [`FilterBoolean`](README.md#filterboolean)<`T`\> \| [`FilterChildren`](README.md#filterchildren)<`T`\> \| `FilterCustom`<`T`\> \| [`FilterField`](README.md#filterfield)<`T`\> \| [`FilterNumber`](README.md#filternumber)<`T`\> \| [`FilterGroup`](README.md#filtergroup)<`T`\> \| [`FilterString`](README.md#filterstring)<`T`\> \| [`FilterStringIntersect`](README.md#filterstringintersect)<`T`\> \| [`FilterStringMatch`](README.md#filterstringmatch)<`T`\>
288
288
 
289
289
  Describes a predicate for filtering items.
290
290
 
@@ -296,7 +296,7 @@ Describes a predicate for filtering items.
296
296
 
297
297
  #### Defined in
298
298
 
299
- [lib/types/Filter.ts:14](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Filter.ts#L14)
299
+ [lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Filter.ts#L15)
300
300
 
301
301
  ___
302
302
 
@@ -323,7 +323,7 @@ Checks if a given array field matches a given array value according to a given o
323
323
 
324
324
  #### Defined in
325
325
 
326
- [lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterArray.ts#L7)
326
+ [lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterArray.ts#L7)
327
327
 
328
328
  ___
329
329
 
@@ -349,7 +349,7 @@ Checks if a given boolean field is `true` or `false`.
349
349
 
350
350
  #### Defined in
351
351
 
352
- [lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterBoolean.ts#L6)
352
+ [lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterBoolean.ts#L6)
353
353
 
354
354
  ___
355
355
 
@@ -377,7 +377,7 @@ If `deep` is `true`, also captures all the descendants.
377
377
 
378
378
  #### Defined in
379
379
 
380
- [lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterChildren.ts#L10)
380
+ [lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterChildren.ts#L10)
381
381
 
382
382
  ___
383
383
 
@@ -402,7 +402,7 @@ Checks if a given field exists.
402
402
 
403
403
  #### Defined in
404
404
 
405
- [lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterField.ts#L4)
405
+ [lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterField.ts#L4)
406
406
 
407
407
  ___
408
408
 
@@ -420,7 +420,7 @@ Joins a list of filters with a specific boolean operator.
420
420
 
421
421
  #### Defined in
422
422
 
423
- [lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterGroup.ts#L6)
423
+ [lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterGroup.ts#L6)
424
424
 
425
425
  ___
426
426
 
@@ -439,7 +439,7 @@ Returns object type with field extending the provided `P` type.
439
439
 
440
440
  #### Defined in
441
441
 
442
- [lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterKeys.ts#L4)
442
+ [lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterKeys.ts#L4)
443
443
 
444
444
  ___
445
445
 
@@ -465,7 +465,7 @@ Checks if a given number field matches a given number value according to a given
465
465
 
466
466
  #### Defined in
467
467
 
468
- [lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterNumber.ts#L6)
468
+ [lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterNumber.ts#L6)
469
469
 
470
470
  ___
471
471
 
@@ -475,7 +475,7 @@ ___
475
475
 
476
476
  #### Defined in
477
477
 
478
- [lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterOperator.ts#L3)
478
+ [lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterOperator.ts#L3)
479
479
 
480
480
  ___
481
481
 
@@ -501,7 +501,7 @@ Checks if a given string field matches a given string value according to a given
501
501
 
502
502
  #### Defined in
503
503
 
504
- [lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterString.ts#L6)
504
+ [lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterString.ts#L6)
505
505
 
506
506
  ___
507
507
 
@@ -527,7 +527,7 @@ Checks if a given string field has any of the provided values.
527
527
 
528
528
  #### Defined in
529
529
 
530
- [lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterStringIntersect.ts#L6)
530
+ [lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterStringIntersect.ts#L6)
531
531
 
532
532
  ___
533
533
 
@@ -557,7 +557,7 @@ Checks if a given string field matches a given regular expression.
557
557
 
558
558
  #### Defined in
559
559
 
560
- [lib/types/FilterStringMatch.ts:8](https://github.com/nevoland/quetch/blob/044bd59/lib/types/FilterStringMatch.ts#L8)
560
+ [lib/types/FilterStringMatch.ts:8](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/FilterStringMatch.ts#L8)
561
561
 
562
562
  ___
563
563
 
@@ -577,7 +577,7 @@ Returns the type of the property at the specified `K` key.
577
577
 
578
578
  #### Defined in
579
579
 
580
- [lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Get.ts#L4)
580
+ [lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Get.ts#L4)
581
581
 
582
582
  ___
583
583
 
@@ -595,7 +595,7 @@ Specifies how items should be grouped.
595
595
 
596
596
  #### Defined in
597
597
 
598
- [lib/types/Group.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Group.ts#L6)
598
+ [lib/types/Group.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Group.ts#L6)
599
599
 
600
600
  ___
601
601
 
@@ -631,7 +631,7 @@ Handles an `input` query and returns an `output` promise, eventually using the `
631
631
 
632
632
  #### Defined in
633
633
 
634
- [lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Handler.ts#L6)
634
+ [lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Handler.ts#L6)
635
635
 
636
636
  ___
637
637
 
@@ -647,7 +647,7 @@ ___
647
647
 
648
648
  #### Defined in
649
649
 
650
- [lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Immutable.ts#L1)
650
+ [lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Immutable.ts#L1)
651
651
 
652
652
  ___
653
653
 
@@ -666,7 +666,7 @@ Injects the custom fields into the entity type.
666
666
 
667
667
  #### Defined in
668
668
 
669
- [lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/044bd59/lib/types/InjectCustomFields.ts#L8)
669
+ [lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/InjectCustomFields.ts#L8)
670
670
 
671
671
  ___
672
672
 
@@ -685,7 +685,7 @@ Returns the inferred item type of an array, or an alternative type if it is some
685
685
 
686
686
  #### Defined in
687
687
 
688
- [lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Item.ts#L4)
688
+ [lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Item.ts#L4)
689
689
 
690
690
  ___
691
691
 
@@ -695,7 +695,7 @@ ___
695
695
 
696
696
  #### Defined in
697
697
 
698
- [lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Key.ts#L1)
698
+ [lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Key.ts#L1)
699
699
 
700
700
  ___
701
701
 
@@ -711,7 +711,7 @@ ___
711
711
 
712
712
  #### Defined in
713
713
 
714
- [lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Mutable.ts#L1)
714
+ [lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Mutable.ts#L1)
715
715
 
716
716
  ___
717
717
 
@@ -744,7 +744,7 @@ Handles an `input` query and returns an `output` promise.
744
744
 
745
745
  #### Defined in
746
746
 
747
- [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/NextHandler.ts#L4)
747
+ [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/NextHandler.ts#L4)
748
748
 
749
749
  ___
750
750
 
@@ -762,7 +762,7 @@ Order item.
762
762
 
763
763
  #### Defined in
764
764
 
765
- [lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Order.ts#L4)
765
+ [lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Order.ts#L4)
766
766
 
767
767
  ___
768
768
 
@@ -783,7 +783,7 @@ Query that fetches or mutates an entity.
783
783
 
784
784
  #### Defined in
785
785
 
786
- [lib/types/Query.ts:29](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Query.ts#L29)
786
+ [lib/types/Query.ts:29](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Query.ts#L29)
787
787
 
788
788
  ___
789
789
 
@@ -809,7 +809,7 @@ Query for computing an aggregated value.
809
809
 
810
810
  #### Defined in
811
811
 
812
- [lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryAggregate.ts#L7)
812
+ [lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryAggregate.ts#L7)
813
813
 
814
814
  ___
815
815
 
@@ -819,7 +819,7 @@ ___
819
819
 
820
820
  #### Defined in
821
821
 
822
- [lib/types/QueryAny.ts:5](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryAny.ts#L5)
822
+ [lib/types/QueryAny.ts:5](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryAny.ts#L5)
823
823
 
824
824
  ___
825
825
 
@@ -845,7 +845,7 @@ Query for creating an item.
845
845
 
846
846
  #### Defined in
847
847
 
848
- [lib/types/QueryCreate.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryCreate.ts#L4)
848
+ [lib/types/QueryCreate.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryCreate.ts#L4)
849
849
 
850
850
  ___
851
851
 
@@ -871,7 +871,7 @@ Query for creating multiple items.
871
871
 
872
872
  #### Defined in
873
873
 
874
- [lib/types/QueryCreateMultiple.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryCreateMultiple.ts#L4)
874
+ [lib/types/QueryCreateMultiple.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryCreateMultiple.ts#L4)
875
875
 
876
876
  ___
877
877
 
@@ -898,7 +898,7 @@ Query for deleting an item.
898
898
 
899
899
  #### Defined in
900
900
 
901
- [lib/types/QueryDelete.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryDelete.ts#L7)
901
+ [lib/types/QueryDelete.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryDelete.ts#L7)
902
902
 
903
903
  ___
904
904
 
@@ -925,7 +925,7 @@ Query for deleting multiple items.
925
925
 
926
926
  #### Defined in
927
927
 
928
- [lib/types/QueryDeleteMultiple.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryDeleteMultiple.ts#L7)
928
+ [lib/types/QueryDeleteMultiple.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryDeleteMultiple.ts#L7)
929
929
 
930
930
  ___
931
931
 
@@ -937,7 +937,7 @@ Available query methods.
937
937
 
938
938
  #### Defined in
939
939
 
940
- [lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryMethod.ts#L6)
940
+ [lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryMethod.ts#L6)
941
941
 
942
942
  ___
943
943
 
@@ -968,7 +968,7 @@ Query for reading a single item.
968
968
 
969
969
  #### Defined in
970
970
 
971
- [lib/types/QueryRead.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryRead.ts#L7)
971
+ [lib/types/QueryRead.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryRead.ts#L7)
972
972
 
973
973
  ___
974
974
 
@@ -999,7 +999,7 @@ Query for getting a list of items.
999
999
 
1000
1000
  #### Defined in
1001
1001
 
1002
- [lib/types/QueryReadMultiple.ts:8](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryReadMultiple.ts#L8)
1002
+ [lib/types/QueryReadMultiple.ts:8](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryReadMultiple.ts#L8)
1003
1003
 
1004
1004
  ___
1005
1005
 
@@ -1023,7 +1023,7 @@ ___
1023
1023
 
1024
1024
  #### Defined in
1025
1025
 
1026
- [lib/types/QuerySettings.ts:5](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QuerySettings.ts#L5)
1026
+ [lib/types/QuerySettings.ts:5](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QuerySettings.ts#L5)
1027
1027
 
1028
1028
  ___
1029
1029
 
@@ -1053,7 +1053,7 @@ Query for updating an item.
1053
1053
 
1054
1054
  #### Defined in
1055
1055
 
1056
- [lib/types/QueryUpdate.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryUpdate.ts#L6)
1056
+ [lib/types/QueryUpdate.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryUpdate.ts#L6)
1057
1057
 
1058
1058
  ___
1059
1059
 
@@ -1083,7 +1083,7 @@ Query for updating multiple items.
1083
1083
 
1084
1084
  #### Defined in
1085
1085
 
1086
- [lib/types/QueryUpdateMultiple.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/types/QueryUpdateMultiple.ts#L7)
1086
+ [lib/types/QueryUpdateMultiple.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryUpdateMultiple.ts#L7)
1087
1087
 
1088
1088
  ___
1089
1089
 
@@ -1102,7 +1102,7 @@ ___
1102
1102
 
1103
1103
  #### Defined in
1104
1104
 
1105
- [lib/types/Result.ts:26](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Result.ts#L26)
1105
+ [lib/types/Result.ts:26](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Result.ts#L26)
1106
1106
 
1107
1107
  ___
1108
1108
 
@@ -1127,7 +1127,7 @@ ___
1127
1127
 
1128
1128
  #### Defined in
1129
1129
 
1130
- [lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/044bd59/lib/types/Store.ts#L2)
1130
+ [lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/Store.ts#L2)
1131
1131
 
1132
1132
  ## Functions
1133
1133
 
@@ -1168,7 +1168,7 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
1168
1168
 
1169
1169
  #### Defined in
1170
1170
 
1171
- [lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/aggregate.ts#L16)
1171
+ [lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/aggregate.ts#L16)
1172
1172
 
1173
1173
  ___
1174
1174
 
@@ -1210,7 +1210,7 @@ const customFetch = combine(
1210
1210
 
1211
1211
  #### Defined in
1212
1212
 
1213
- [lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/branch.ts#L21)
1213
+ [lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/branch.ts#L21)
1214
1214
 
1215
1215
  ___
1216
1216
 
@@ -1239,7 +1239,7 @@ ___
1239
1239
 
1240
1240
  #### Defined in
1241
1241
 
1242
- [lib/middlewares/cache.ts:39](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/cache.ts#L39)
1242
+ [lib/middlewares/cache.ts:39](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/cache.ts#L39)
1243
1243
 
1244
1244
  ___
1245
1245
 
@@ -1312,7 +1312,7 @@ Handler that combines all provided handlers.
1312
1312
 
1313
1313
  #### Defined in
1314
1314
 
1315
- [lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/combine.ts#L801)
1315
+ [lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/combine.ts#L801)
1316
1316
 
1317
1317
  ___
1318
1318
 
@@ -1334,7 +1334,7 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
1334
1334
 
1335
1335
  #### Defined in
1336
1336
 
1337
- [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/044bd59/lib/types/NextHandler.ts#L4)
1337
+ [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/NextHandler.ts#L4)
1338
1338
 
1339
1339
  ___
1340
1340
 
@@ -1399,7 +1399,7 @@ typeof `query`
1399
1399
 
1400
1400
  #### Defined in
1401
1401
 
1402
- [lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/defineCheckQuery.ts#L8)
1402
+ [lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/defineCheckQuery.ts#L8)
1403
1403
 
1404
1404
  ___
1405
1405
 
@@ -1506,7 +1506,7 @@ ___
1506
1506
 
1507
1507
  #### Defined in
1508
1508
 
1509
- [lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/defineCustomFetch.ts#L11)
1509
+ [lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/defineCustomFetch.ts#L11)
1510
1510
 
1511
1511
  ___
1512
1512
 
@@ -1581,7 +1581,7 @@ ___
1581
1581
 
1582
1582
  #### Defined in
1583
1583
 
1584
- [lib/tools/defineGenericFetch.ts:5](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/defineGenericFetch.ts#L5)
1584
+ [lib/tools/defineGenericFetch.ts:5](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/defineGenericFetch.ts#L5)
1585
1585
 
1586
1586
  ___
1587
1587
 
@@ -1605,7 +1605,7 @@ Escaped regular expression
1605
1605
 
1606
1606
  #### Defined in
1607
1607
 
1608
- [lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/escapeRegex.ts#L7)
1608
+ [lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/escapeRegex.ts#L7)
1609
1609
 
1610
1610
  ___
1611
1611
 
@@ -1629,7 +1629,7 @@ Handler that returns a promise that resolves to the response.
1629
1629
 
1630
1630
  #### Defined in
1631
1631
 
1632
- [lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/fetchExternal.ts#L12)
1632
+ [lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/fetchExternal.ts#L12)
1633
1633
 
1634
1634
  ___
1635
1635
 
@@ -1653,7 +1653,7 @@ Promise that resolves to the response.
1653
1653
 
1654
1654
  #### Defined in
1655
1655
 
1656
- [lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/fetchLocal.ts#L9)
1656
+ [lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/fetchLocal.ts#L9)
1657
1657
 
1658
1658
  ▸ **fetchLocal**<`T`, `C`\>(): [`Handler`](README.md#handler)<[`Query`](README.md#query)<`T`, `C`\> & { `customFields`: `C` ; `type`: `T`[] }, `any`, `never`, `never`\>
1659
1659
 
@@ -1670,7 +1670,7 @@ Promise that resolves to the response.
1670
1670
 
1671
1671
  #### Defined in
1672
1672
 
1673
- [lib/middlewares/fetchLocal.ts:15](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/fetchLocal.ts#L15)
1673
+ [lib/middlewares/fetchLocal.ts:15](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/fetchLocal.ts#L15)
1674
1674
 
1675
1675
  ___
1676
1676
 
@@ -1699,7 +1699,7 @@ ___
1699
1699
 
1700
1700
  #### Defined in
1701
1701
 
1702
- [lib/tools/filterChildren.ts:5](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/filterChildren.ts#L5)
1702
+ [lib/tools/filterChildren.ts:5](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/filterChildren.ts#L5)
1703
1703
 
1704
1704
  ___
1705
1705
 
@@ -1725,7 +1725,7 @@ ___
1725
1725
 
1726
1726
  #### Defined in
1727
1727
 
1728
- [lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/filterFromContext.ts#L5)
1728
+ [lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/filterFromContext.ts#L5)
1729
1729
 
1730
1730
  ___
1731
1731
 
@@ -1757,7 +1757,7 @@ Checks wether the provided `value` matches the `filter` or not.
1757
1757
 
1758
1758
  #### Defined in
1759
1759
 
1760
- [lib/tools/filterItem.ts:17](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/filterItem.ts#L17)
1760
+ [lib/tools/filterItem.ts:17](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/filterItem.ts#L17)
1761
1761
 
1762
1762
  ___
1763
1763
 
@@ -1787,7 +1787,7 @@ ___
1787
1787
 
1788
1788
  #### Defined in
1789
1789
 
1790
- [lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/identity.ts#L3)
1790
+ [lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/identity.ts#L3)
1791
1791
 
1792
1792
  ___
1793
1793
 
@@ -1795,7 +1795,7 @@ ___
1795
1795
 
1796
1796
  ▸ **isFilterGroup**<`T`\>(`value`): value is FilterGroup<T\>
1797
1797
 
1798
- Return `true` if the provided filter `value` is a group filter or not.
1798
+ Returns `true` if the provided filter `value` is a group filter or not.
1799
1799
 
1800
1800
  #### Type parameters
1801
1801
 
@@ -1817,7 +1817,7 @@ Whether the provided filter is a group filter or not.
1817
1817
 
1818
1818
  #### Defined in
1819
1819
 
1820
- [lib/tools/isFilterGroup.ts:9](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/isFilterGroup.ts#L9)
1820
+ [lib/tools/isFilterGroup.ts:9](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/isFilterGroup.ts#L9)
1821
1821
 
1822
1822
  ___
1823
1823
 
@@ -1850,7 +1850,7 @@ Query handler
1850
1850
 
1851
1851
  #### Defined in
1852
1852
 
1853
- [lib/middlewares/log.ts:13](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/log.ts#L13)
1853
+ [lib/middlewares/log.ts:13](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/log.ts#L13)
1854
1854
 
1855
1855
  ___
1856
1856
 
@@ -1881,7 +1881,7 @@ ___
1881
1881
 
1882
1882
  #### Defined in
1883
1883
 
1884
- [lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/normalizeOrder.ts#L3)
1884
+ [lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/normalizeOrder.ts#L3)
1885
1885
 
1886
1886
  ___
1887
1887
 
@@ -1908,7 +1908,7 @@ ___
1908
1908
 
1909
1909
  #### Defined in
1910
1910
 
1911
- [lib/tools/queryItemList.ts:43](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/queryItemList.ts#L43)
1911
+ [lib/tools/queryItemList.ts:43](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/queryItemList.ts#L43)
1912
1912
 
1913
1913
  ▸ **queryItemList**<`T`, `Q`, `C`\>(`query`): [`Result`](README.md#result)<`T`, `Q`, `C`\>
1914
1914
 
@@ -1932,7 +1932,7 @@ ___
1932
1932
 
1933
1933
  #### Defined in
1934
1934
 
1935
- [lib/tools/queryItemList.ts:46](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/queryItemList.ts#L46)
1935
+ [lib/tools/queryItemList.ts:46](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/queryItemList.ts#L46)
1936
1936
 
1937
1937
  ___
1938
1938
 
@@ -1961,7 +1961,7 @@ Handler
1961
1961
 
1962
1962
  #### Defined in
1963
1963
 
1964
- [lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/044bd59/lib/middlewares/retry.ts#L15)
1964
+ [lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/retry.ts#L15)
1965
1965
 
1966
1966
  ___
1967
1967
 
@@ -1992,4 +1992,4 @@ The same array sorted in place.
1992
1992
 
1993
1993
  #### Defined in
1994
1994
 
1995
- [lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/044bd59/lib/tools/sortItemList.ts#L12)
1995
+ [lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/sortItemList.ts#L12)
@@ -32,7 +32,7 @@
32
32
 
33
33
  #### Defined in
34
34
 
35
- [lib/types/CustomFetch.ts:6](https://github.com/nevoland/quetch/blob/044bd59/lib/types/CustomFetch.ts#L6)
35
+ [lib/types/CustomFetch.ts:6](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/CustomFetch.ts#L6)
36
36
 
37
37
  ### CustomFetch
38
38
 
@@ -57,4 +57,4 @@
57
57
 
58
58
  #### Defined in
59
59
 
60
- [lib/types/CustomFetch.ts:9](https://github.com/nevoland/quetch/blob/044bd59/lib/types/CustomFetch.ts#L9)
60
+ [lib/types/CustomFetch.ts:9](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/CustomFetch.ts#L9)
@@ -1,7 +1,7 @@
1
1
  import type { Filter, FilterGroup } from "../types";
2
2
 
3
3
  /**
4
- * Return `true` if the provided filter `value` is a group filter or not.
4
+ * Returns `true` if the provided filter `value` is a group filter or not.
5
5
  *
6
6
  * @param value The filter to test.
7
7
  * @returns Whether the provided filter is a group filter or not.
@@ -1,6 +1,7 @@
1
1
  import type { FilterArray } from "./FilterArray";
2
2
  import type { FilterBoolean } from "./FilterBoolean";
3
3
  import type { FilterChildren } from "./FilterChildren";
4
+ import type { FilterCustom } from "./FilterCustom";
4
5
  import type { FilterField } from "./FilterField";
5
6
  import type { FilterGroup } from "./FilterGroup";
6
7
  import type { FilterNumber } from "./FilterNumber";
@@ -15,6 +16,7 @@ export type Filter<T extends object> =
15
16
  | FilterArray<T>
16
17
  | FilterBoolean<T>
17
18
  | FilterChildren<T>
19
+ | FilterCustom<T>
18
20
  | FilterField<T>
19
21
  | FilterNumber<T>
20
22
  | FilterGroup<T>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Custom filter where `value(item)` returns `true` for matching items.
3
+ */
4
+ export type FilterCustom<T extends object> = {
5
+ operator: "custom";
6
+ value: (item: T) => boolean;
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quetch",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "main": "./dist/main.js",
6
6
  "exports": {