quetch 0.26.0 → 0.27.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.
Files changed (129) hide show
  1. package/dist/constants/FILTER_ANY.d.ts +3 -0
  2. package/dist/constants/FILTER_ANY.js +2 -0
  3. package/dist/constants/FILTER_ANY.js.map +1 -0
  4. package/dist/constants/FILTER_NONE.d.ts +3 -0
  5. package/dist/constants/FILTER_NONE.js +2 -0
  6. package/dist/constants/FILTER_NONE.js.map +1 -0
  7. package/dist/constants.d.ts +2 -0
  8. package/dist/constants.js +2 -0
  9. package/dist/constants.js.map +1 -1
  10. package/dist/tools/filterChildren.d.ts +2 -2
  11. package/dist/tools/filterFromValue.d.ts +2 -2
  12. package/dist/tools/filterFromValue.js +14 -4
  13. package/dist/tools/filterFromValue.js.map +1 -1
  14. package/dist/tools/testFilter.js.map +1 -1
  15. package/dist/types/FilterChildren.d.ts +2 -2
  16. package/dist/types/IntrinsicFilter.d.ts +7 -0
  17. package/dist/types/IntrinsicFilter.js +1 -0
  18. package/dist/types/IntrinsicFilter.js.map +1 -0
  19. package/dist/types/QuerySettings.d.ts +3 -5
  20. package/dist/types.d.ts +1 -0
  21. package/doc/README.md +3 -0
  22. package/doc/classes/RequestError.md +5 -5
  23. package/doc/functions/aggregate.md +1 -1
  24. package/doc/functions/branch.md +1 -1
  25. package/doc/functions/cache.md +1 -1
  26. package/doc/functions/combine.md +1 -1
  27. package/doc/functions/cork.md +1 -1
  28. package/doc/functions/defineCheckQuery.md +1 -1
  29. package/doc/functions/defineCustomFetch.md +1 -1
  30. package/doc/functions/defineGenericFetch.md +1 -1
  31. package/doc/functions/escapeRegex.md +1 -1
  32. package/doc/functions/fetchExternal.md +1 -1
  33. package/doc/functions/fetchLocal.md +1 -1
  34. package/doc/functions/fieldListFromFilter.md +1 -1
  35. package/doc/functions/filterChildren.md +3 -3
  36. package/doc/functions/filterFromValue.md +3 -3
  37. package/doc/functions/get.md +1 -1
  38. package/doc/functions/groupFilters.md +2 -2
  39. package/doc/functions/identity.md +1 -1
  40. package/doc/functions/isFilterGroup.md +1 -1
  41. package/doc/functions/log.md +1 -1
  42. package/doc/functions/normalizeOrder.md +1 -1
  43. package/doc/functions/queryItemList.md +1 -1
  44. package/doc/functions/retry.md +1 -1
  45. package/doc/functions/reverseOrder.md +1 -1
  46. package/doc/functions/sameField.md +1 -1
  47. package/doc/functions/sortItemList.md +1 -1
  48. package/doc/functions/splitPath.md +2 -2
  49. package/doc/functions/testFilter.md +1 -1
  50. package/doc/interfaces/CustomFetch.md +1 -1
  51. package/doc/type-aliases/AggregateFunction.md +1 -1
  52. package/doc/type-aliases/AggregateFunctionOperator.md +1 -1
  53. package/doc/type-aliases/CombineUnion.md +1 -1
  54. package/doc/type-aliases/Context.md +1 -1
  55. package/doc/type-aliases/CustomFieldAggregateMap.md +1 -1
  56. package/doc/type-aliases/CustomFieldMap.md +1 -1
  57. package/doc/type-aliases/Field.md +1 -1
  58. package/doc/type-aliases/FieldFiltered.md +1 -1
  59. package/doc/type-aliases/FieldFunction.md +1 -1
  60. package/doc/type-aliases/FieldFunctionCustom.md +1 -1
  61. package/doc/type-aliases/FieldFunctionFormatDate.md +1 -1
  62. package/doc/type-aliases/FieldFunctionReturn.md +1 -1
  63. package/doc/type-aliases/FieldKey.md +1 -1
  64. package/doc/type-aliases/FieldMap.md +1 -1
  65. package/doc/type-aliases/Filter.md +1 -1
  66. package/doc/type-aliases/FilterArray.md +1 -1
  67. package/doc/type-aliases/FilterBoolean.md +1 -1
  68. package/doc/type-aliases/FilterChildren.md +2 -2
  69. package/doc/type-aliases/FilterCustom.md +1 -1
  70. package/doc/type-aliases/FilterField.md +1 -1
  71. package/doc/type-aliases/FilterGroup.md +1 -1
  72. package/doc/type-aliases/FilterNumber.md +1 -1
  73. package/doc/type-aliases/FilterOperator.md +1 -1
  74. package/doc/type-aliases/FilterString.md +1 -1
  75. package/doc/type-aliases/FilterStringIntersect.md +1 -1
  76. package/doc/type-aliases/FilterStringMatch.md +1 -1
  77. package/doc/type-aliases/Get.md +1 -1
  78. package/doc/type-aliases/Group.md +1 -1
  79. package/doc/type-aliases/Handler.md +1 -1
  80. package/doc/type-aliases/Immutable.md +1 -1
  81. package/doc/type-aliases/Increment.md +1 -1
  82. package/doc/type-aliases/InjectCustomFields.md +1 -1
  83. package/doc/type-aliases/IntersectUnion.md +1 -1
  84. package/doc/type-aliases/IntrinsicFilter.md +19 -0
  85. package/doc/type-aliases/Item.md +1 -1
  86. package/doc/type-aliases/Join.md +1 -1
  87. package/doc/type-aliases/Key.md +1 -1
  88. package/doc/type-aliases/KeyFiltered.md +1 -1
  89. package/doc/type-aliases/KeyFromUnion.md +1 -1
  90. package/doc/type-aliases/Locale.md +1 -1
  91. package/doc/type-aliases/NextHandler.md +1 -1
  92. package/doc/type-aliases/Order.md +1 -1
  93. package/doc/type-aliases/OrderNormalized.md +1 -1
  94. package/doc/type-aliases/Parameters.md +1 -1
  95. package/doc/type-aliases/Path.md +1 -1
  96. package/doc/type-aliases/PathFiltered.md +1 -1
  97. package/doc/type-aliases/Primitive.md +1 -1
  98. package/doc/type-aliases/PrimitiveObject.md +1 -1
  99. package/doc/type-aliases/Query.md +1 -1
  100. package/doc/type-aliases/QueryAggregate.md +1 -1
  101. package/doc/type-aliases/QueryCreate.md +1 -1
  102. package/doc/type-aliases/QueryCreateMultiple.md +1 -1
  103. package/doc/type-aliases/QueryDelete.md +1 -1
  104. package/doc/type-aliases/QueryDeleteMultiple.md +1 -1
  105. package/doc/type-aliases/QueryMethod.md +1 -1
  106. package/doc/type-aliases/QueryRead.md +1 -1
  107. package/doc/type-aliases/QueryReadMultiple.md +1 -1
  108. package/doc/type-aliases/QuerySettings.md +4 -4
  109. package/doc/type-aliases/QueryUpdate.md +1 -1
  110. package/doc/type-aliases/QueryUpdateMultiple.md +1 -1
  111. package/doc/type-aliases/Result.md +1 -1
  112. package/doc/type-aliases/Store.md +1 -1
  113. package/doc/type-aliases/Value.md +1 -1
  114. package/doc/type-aliases/ValueMap.md +1 -1
  115. package/doc/variables/CACHE.md +1 -1
  116. package/doc/variables/FILTER_ANY.md +19 -0
  117. package/doc/variables/FILTER_NONE.md +19 -0
  118. package/doc/variables/SELF.md +1 -1
  119. package/lib/constants/FILTER_ANY.ts +1 -0
  120. package/lib/constants/FILTER_NONE.ts +1 -0
  121. package/lib/constants.ts +2 -0
  122. package/lib/tools/filterChildren.ts +2 -2
  123. package/lib/tools/filterFromValue.ts +19 -9
  124. package/lib/tools/testFilter.ts +1 -1
  125. package/lib/types/FilterChildren.ts +2 -2
  126. package/lib/types/IntrinsicFilter.ts +9 -0
  127. package/lib/types/QuerySettings.ts +3 -5
  128. package/lib/types.ts +1 -0
  129. package/package.json +1 -1
@@ -30,4 +30,4 @@ Formats the date found in a given field, which can be an ISO string date or a ti
30
30
 
31
31
  ## Defined in
32
32
 
33
- [lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FieldFunctionFormatDate.ts#L6)
33
+ [lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FieldFunctionFormatDate.ts#L6)
@@ -18,4 +18,4 @@ Return types of custom field functions.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FieldFunctionReturn.ts#L4)
21
+ [lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FieldFunctionReturn.ts#L4)
@@ -14,4 +14,4 @@
14
14
 
15
15
  ## Defined in
16
16
 
17
- [lib/types/FieldKey.ts:5](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FieldKey.ts#L5)
17
+ [lib/types/FieldKey.ts:5](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FieldKey.ts#L5)
@@ -18,4 +18,4 @@ Maps the fields of the provided value `T` to a specific value `V`.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/FieldMap.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FieldMap.ts#L6)
21
+ [lib/types/FieldMap.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FieldMap.ts#L6)
@@ -16,4 +16,4 @@ Describes a predicate for filtering items.
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Filter.ts#L15)
19
+ [lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Filter.ts#L15)
@@ -32,4 +32,4 @@ Checks if a given array field matches a given array value according to a given o
32
32
 
33
33
  ## Defined in
34
34
 
35
- [lib/types/FilterArray.ts:11](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterArray.ts#L11)
35
+ [lib/types/FilterArray.ts:11](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterArray.ts#L11)
@@ -26,4 +26,4 @@ Checks if a given boolean field is `true` or `false`.
26
26
 
27
27
  ## Defined in
28
28
 
29
- [lib/types/FilterBoolean.ts:7](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterBoolean.ts#L7)
29
+ [lib/types/FilterBoolean.ts:7](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterBoolean.ts#L7)
@@ -19,7 +19,7 @@ If `deep` is `true`, also captures all the descendants.
19
19
 
20
20
  ### \[CACHE\]?
21
21
 
22
- > `optional` **\[CACHE\]**: [`Filter`](Filter.md)\<`T`\>
22
+ > `optional` **\[CACHE\]**: [`IntrinsicFilter`](IntrinsicFilter.md)\<`T`\>
23
23
 
24
24
  ### deep?
25
25
 
@@ -35,4 +35,4 @@ If `deep` is `true`, also captures all the descendants.
35
35
 
36
36
  ## Defined in
37
37
 
38
- [lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterChildren.ts#L10)
38
+ [lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterChildren.ts#L10)
@@ -36,4 +36,4 @@ Custom filter where `value(item)` returns `true` for matching items.
36
36
 
37
37
  ## Defined in
38
38
 
39
- [lib/types/FilterCustom.ts:4](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterCustom.ts#L4)
39
+ [lib/types/FilterCustom.ts:4](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterCustom.ts#L4)
@@ -28,4 +28,4 @@ The field name or path for which to check its existence.
28
28
 
29
29
  ## Defined in
30
30
 
31
- [lib/types/FilterField.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterField.ts#L6)
31
+ [lib/types/FilterField.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterField.ts#L6)
@@ -84,4 +84,4 @@ Filters to join.
84
84
 
85
85
  ## Defined in
86
86
 
87
- [lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterGroup.ts#L6)
87
+ [lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterGroup.ts#L6)
@@ -26,4 +26,4 @@ Checks if a given number field matches a given number value according to a given
26
26
 
27
27
  ## Defined in
28
28
 
29
- [lib/types/FilterNumber.ts:7](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterNumber.ts#L7)
29
+ [lib/types/FilterNumber.ts:7](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterNumber.ts#L7)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterOperator.ts#L3)
13
+ [lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterOperator.ts#L3)
@@ -34,4 +34,4 @@ Checks if a given string field matches a given string value according to a given
34
34
 
35
35
  ## Defined in
36
36
 
37
- [lib/types/FilterString.ts:8](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterString.ts#L8)
37
+ [lib/types/FilterString.ts:8](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterString.ts#L8)
@@ -34,4 +34,4 @@ Checks if a given string field has any of the provided values.
34
34
 
35
35
  ## Defined in
36
36
 
37
- [lib/types/FilterStringIntersect.ts:8](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterStringIntersect.ts#L8)
37
+ [lib/types/FilterStringIntersect.ts:8](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterStringIntersect.ts#L8)
@@ -50,4 +50,4 @@ Ignore casing differences if `true`.
50
50
 
51
51
  ## Defined in
52
52
 
53
- [lib/types/FilterStringMatch.ts:9](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/FilterStringMatch.ts#L9)
53
+ [lib/types/FilterStringMatch.ts:9](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/FilterStringMatch.ts#L9)
@@ -18,4 +18,4 @@ Returns the type of the property at the specified `P` path.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/Get.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Get.ts#L6)
21
+ [lib/types/Get.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Get.ts#L6)
@@ -16,4 +16,4 @@ Specifies how items should be grouped.
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Group.ts:4](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Group.ts#L4)
19
+ [lib/types/Group.ts:4](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Group.ts#L4)
@@ -36,4 +36,4 @@ Handles an `input` query and returns an `output` promise, eventually using the `
36
36
 
37
37
  ## Defined in
38
38
 
39
- [lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Handler.ts#L6)
39
+ [lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Handler.ts#L6)
@@ -14,4 +14,4 @@
14
14
 
15
15
  ## Defined in
16
16
 
17
- [lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Immutable.ts#L1)
17
+ [lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Immutable.ts#L1)
@@ -14,4 +14,4 @@
14
14
 
15
15
  ## Defined in
16
16
 
17
- [lib/types/Increment.ts:5](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Increment.ts#L5)
17
+ [lib/types/Increment.ts:5](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Increment.ts#L5)
@@ -18,4 +18,4 @@ Injects the custom fields into the entity type.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/InjectCustomFields.ts#L8)
21
+ [lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/InjectCustomFields.ts#L8)
@@ -14,4 +14,4 @@
14
14
 
15
15
  ## Defined in
16
16
 
17
- [lib/types/IntersectUnion.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/IntersectUnion.ts#L1)
17
+ [lib/types/IntersectUnion.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/IntersectUnion.ts#L1)
@@ -0,0 +1,19 @@
1
+ [**quetch**](../README.md)
2
+
3
+ ***
4
+
5
+ [quetch](../README.md) / IntrinsicFilter
6
+
7
+ # Type Alias: IntrinsicFilter\<T\>
8
+
9
+ > **IntrinsicFilter**\<`T`\>: `Exclude`\<[`Filter`](Filter.md)\<`T`\>, `object`\>
10
+
11
+ Filter that does not rely on query settings, and thus can be evaluated directly on the items.
12
+
13
+ ## Type Parameters
14
+
15
+ • **T**
16
+
17
+ ## Defined in
18
+
19
+ [lib/types/IntrinsicFilter.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/IntrinsicFilter.ts#L6)
@@ -18,4 +18,4 @@ Returns the inferred item type of an array, or an alternative type if it is some
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Item.ts#L4)
21
+ [lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Item.ts#L4)
@@ -16,4 +16,4 @@
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Join.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Join.ts#L1)
19
+ [lib/types/Join.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Join.ts#L1)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Key.ts#L1)
13
+ [lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Key.ts#L1)
@@ -18,4 +18,4 @@ Returns union of keys whose mapped value extend the provided `P` type.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/KeyFiltered.ts:10](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/KeyFiltered.ts#L10)
21
+ [lib/types/KeyFiltered.ts:10](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/KeyFiltered.ts#L10)
@@ -14,4 +14,4 @@
14
14
 
15
15
  ## Defined in
16
16
 
17
- [lib/types/KeyFromUnion.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/KeyFromUnion.ts#L1)
17
+ [lib/types/KeyFromUnion.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/KeyFromUnion.ts#L1)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/Locale.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Locale.ts#L1)
13
+ [lib/types/Locale.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Locale.ts#L1)
@@ -28,4 +28,4 @@ Handles an `input` query and returns an `output` promise.
28
28
 
29
29
  ## Defined in
30
30
 
31
- [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/NextHandler.ts#L4)
31
+ [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/NextHandler.ts#L4)
@@ -16,4 +16,4 @@ Order item.
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Order.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Order.ts#L6)
19
+ [lib/types/Order.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Order.ts#L6)
@@ -24,4 +24,4 @@
24
24
 
25
25
  ## Defined in
26
26
 
27
- [lib/types/OrderNormalized.ts:3](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/OrderNormalized.ts#L3)
27
+ [lib/types/OrderNormalized.ts:3](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/OrderNormalized.ts#L3)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Parameters.ts#L1)
13
+ [lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Parameters.ts#L1)
@@ -16,4 +16,4 @@
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Path.ts:5](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Path.ts#L5)
19
+ [lib/types/Path.ts:5](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Path.ts#L5)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/PathFiltered.ts:4](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/PathFiltered.ts#L4)
21
+ [lib/types/PathFiltered.ts:4](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/PathFiltered.ts#L4)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/Primitive.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Primitive.ts#L1)
13
+ [lib/types/Primitive.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Primitive.ts#L1)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/PrimitiveObject.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/PrimitiveObject.ts#L1)
13
+ [lib/types/PrimitiveObject.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/PrimitiveObject.ts#L1)
@@ -16,4 +16,4 @@ Query that fetches or mutates an entity.
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Query.ts:14](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Query.ts#L14)
19
+ [lib/types/Query.ts:14](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Query.ts#L14)
@@ -68,4 +68,4 @@ Query settings.
68
68
 
69
69
  ## Defined in
70
70
 
71
- [lib/types/QueryAggregate.ts:11](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryAggregate.ts#L11)
71
+ [lib/types/QueryAggregate.ts:11](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryAggregate.ts#L11)
@@ -50,4 +50,4 @@ Value properties of the item to create.
50
50
 
51
51
  ## Defined in
52
52
 
53
- [lib/types/QueryCreate.ts:8](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryCreate.ts#L8)
53
+ [lib/types/QueryCreate.ts:8](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryCreate.ts#L8)
@@ -48,4 +48,4 @@ Query settings.
48
48
 
49
49
  ## Defined in
50
50
 
51
- [lib/types/QueryCreateMultiple.ts:8](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryCreateMultiple.ts#L8)
51
+ [lib/types/QueryCreateMultiple.ts:8](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryCreateMultiple.ts#L8)
@@ -60,4 +60,4 @@ Query settings.
60
60
 
61
61
  ## Defined in
62
62
 
63
- [lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryDelete.ts#L9)
63
+ [lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryDelete.ts#L9)
@@ -62,4 +62,4 @@ Query settings.
62
62
 
63
63
  ## Defined in
64
64
 
65
- [lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryDeleteMultiple.ts#L9)
65
+ [lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryDeleteMultiple.ts#L9)
@@ -12,4 +12,4 @@ Available query methods.
12
12
 
13
13
  ## Defined in
14
14
 
15
- [lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryMethod.ts#L6)
15
+ [lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryMethod.ts#L6)
@@ -76,4 +76,4 @@ Query settings.
76
76
 
77
77
  ## Defined in
78
78
 
79
- [lib/types/QueryRead.ts:10](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryRead.ts#L10)
79
+ [lib/types/QueryRead.ts:10](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryRead.ts#L10)
@@ -80,4 +80,4 @@ Query settings.
80
80
 
81
81
  ## Defined in
82
82
 
83
- [lib/types/QueryReadMultiple.ts:11](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryReadMultiple.ts#L11)
83
+ [lib/types/QueryReadMultiple.ts:11](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryReadMultiple.ts#L11)
@@ -60,9 +60,9 @@ Abort signal to abort the query.
60
60
 
61
61
  ### transformFilterChildren()?
62
62
 
63
- > `optional` **transformFilterChildren**: (`filter`) => `Exclude`\<[`Filter`](Filter.md)\<`T`\>, `object`\>
63
+ > `optional` **transformFilterChildren**: (`filter`) => [`IntrinsicFilter`](IntrinsicFilter.md)\<`T`\>
64
64
 
65
- Returns a filter that captures the items expressed by the provided `FilterChildren`. The return filter cannot use filters of type `FilterChildren`.
65
+ Returns a filter that captures the items expressed by the provided `FilterChildren`. The return filter cannot use filters of type `FilterChildren` or `FilterContext`.
66
66
 
67
67
  #### Parameters
68
68
 
@@ -74,10 +74,10 @@ The provided `FilterChildren` to express.
74
74
 
75
75
  #### Returns
76
76
 
77
- `Exclude`\<[`Filter`](Filter.md)\<`T`\>, `object`\>
77
+ [`IntrinsicFilter`](IntrinsicFilter.md)\<`T`\>
78
78
 
79
79
  A filter that captures the items expressed by the provided `FilterChildren`.
80
80
 
81
81
  ## Defined in
82
82
 
83
- [lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QuerySettings.ts#L8)
83
+ [lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QuerySettings.ts#L8)
@@ -68,4 +68,4 @@ Partial property values to update.
68
68
 
69
69
  ## Defined in
70
70
 
71
- [lib/types/QueryUpdate.ts:9](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryUpdate.ts#L9)
71
+ [lib/types/QueryUpdate.ts:9](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryUpdate.ts#L9)
@@ -74,4 +74,4 @@ Partial property values to update.
74
74
 
75
75
  ## Defined in
76
76
 
77
- [lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/QueryUpdateMultiple.ts#L10)
77
+ [lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/QueryUpdateMultiple.ts#L10)
@@ -16,4 +16,4 @@
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Result.ts:20](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Result.ts#L20)
19
+ [lib/types/Result.ts:20](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Result.ts#L20)
@@ -68,4 +68,4 @@
68
68
 
69
69
  ## Defined in
70
70
 
71
- [lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Store.ts#L2)
71
+ [lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Store.ts#L2)
@@ -36,4 +36,4 @@ Path leading to the value.
36
36
 
37
37
  ## Defined in
38
38
 
39
- [lib/types/Value.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/Value.ts#L6)
39
+ [lib/types/Value.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/Value.ts#L6)
@@ -18,4 +18,4 @@ Maps the properties of the provided value `T` to a specific value `V`.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/ValueMap.ts:6](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/types/ValueMap.ts#L6)
21
+ [lib/types/ValueMap.ts:6](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/types/ValueMap.ts#L6)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/constants/CACHE.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/constants/CACHE.ts#L1)
13
+ [lib/constants/CACHE.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/constants/CACHE.ts#L1)
@@ -0,0 +1,19 @@
1
+ [**quetch**](../README.md)
2
+
3
+ ***
4
+
5
+ [quetch](../README.md) / FILTER\_ANY
6
+
7
+ # Variable: FILTER\_ANY
8
+
9
+ > `const` **FILTER\_ANY**: `object`
10
+
11
+ ## Type declaration
12
+
13
+ ### operator
14
+
15
+ > `readonly` **operator**: `"any"` = `"any"`
16
+
17
+ ## Defined in
18
+
19
+ [lib/constants/FILTER\_ANY.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/constants/FILTER_ANY.ts#L1)
@@ -0,0 +1,19 @@
1
+ [**quetch**](../README.md)
2
+
3
+ ***
4
+
5
+ [quetch](../README.md) / FILTER\_NONE
6
+
7
+ # Variable: FILTER\_NONE
8
+
9
+ > `const` **FILTER\_NONE**: `object`
10
+
11
+ ## Type declaration
12
+
13
+ ### operator
14
+
15
+ > `readonly` **operator**: `"none"` = `"none"`
16
+
17
+ ## Defined in
18
+
19
+ [lib/constants/FILTER\_NONE.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/constants/FILTER_NONE.ts#L1)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/constants/SELF.ts:1](https://github.com/nevoland/quetch/blob/1dbcbe5bf2276e5e4dfe5bc56d7adf82ee0d0a42/lib/constants/SELF.ts#L1)
13
+ [lib/constants/SELF.ts:1](https://github.com/nevoland/quetch/blob/fe379c4b50ec8fa5471bc145281a4c5256d2f06b/lib/constants/SELF.ts#L1)
@@ -0,0 +1 @@
1
+ export const FILTER_ANY = { operator: "any" } as const;
@@ -0,0 +1 @@
1
+ export const FILTER_NONE = { operator: "none" } as const;
package/lib/constants.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  // File automatically generated by `vite-plugin-module-list`
2
2
  export { CACHE } from "./constants/CACHE.js";
3
+ export { FILTER_ANY } from "./constants/FILTER_ANY.js";
4
+ export { FILTER_NONE } from "./constants/FILTER_NONE.js";
3
5
  export { SELF } from "./constants/SELF.js";
@@ -1,4 +1,4 @@
1
- import type { FieldFiltered, Filter } from "../types.ts";
1
+ import type { FieldFiltered, IntrinsicFilter } from "../types.ts";
2
2
 
3
3
  import { escapeRegex } from "./escapeRegex.js";
4
4
 
@@ -7,7 +7,7 @@ export function filterChildren<T>(
7
7
  pathFieldKey: FieldFiltered<T, string>,
8
8
  deep = false,
9
9
  pathSeparator = "/",
10
- ): Filter<T> {
10
+ ): IntrinsicFilter<T> {
11
11
  return {
12
12
  field: pathFieldKey,
13
13
  operator: "match",
@@ -1,21 +1,31 @@
1
1
  import { EMPTY_ARRAY } from "unchangeable";
2
2
 
3
3
  import { SELF } from "../constants/SELF.js";
4
- import type { Filter } from "../types.js";
4
+ import type { IntrinsicFilter } from "../types.js";
5
5
 
6
6
  const { entries } = Object;
7
7
 
8
- export function filterFromValue<T>(value: T): Filter<T> {
9
- return {
10
- operator: "all",
11
- value: criteria(value),
12
- };
8
+ export function filterFromValue<T>(value: T): IntrinsicFilter<T> {
9
+ const criteriaValue = criteria(value);
10
+ switch (criteriaValue.length) {
11
+ case 0:
12
+ return {
13
+ operator: "any",
14
+ };
15
+ case 1:
16
+ return criteriaValue[0]!;
17
+ default:
18
+ return {
19
+ operator: "all",
20
+ value: criteria(value),
21
+ };
22
+ }
13
23
  }
14
24
 
15
25
  function criteria<T>(
16
26
  value: T,
17
27
  path: readonly string[] = EMPTY_ARRAY,
18
- ): readonly Filter<T>[] {
28
+ ): readonly IntrinsicFilter<T>[] {
19
29
  return entriesAndSelf(value).flatMap(([field, value]) => {
20
30
  switch (typeof value) {
21
31
  case "symbol":
@@ -36,7 +46,7 @@ function criteria<T>(
36
46
  field: path.length === 0 ? field : [...path, field],
37
47
  operator: "equal",
38
48
  value,
39
- } as Filter<T>,
49
+ } as IntrinsicFilter<T>,
40
50
  ];
41
51
  case "object": {
42
52
  if (value == null) {
@@ -45,7 +55,7 @@ function criteria<T>(
45
55
  field: path.length === 0 ? field : [...path, field],
46
56
  operator: "equal",
47
57
  value,
48
- } as Filter<T>,
58
+ } as IntrinsicFilter<T>,
49
59
  ];
50
60
  }
51
61
  return criteria<T>(value, [...path, field as string]);
@@ -127,7 +127,7 @@ export function testFilter<T>(
127
127
  const {
128
128
  pathField = "id" as FieldFiltered<T, string>,
129
129
  pathFieldSeparator,
130
- } = settings || (EMPTY_OBJECT as QuerySettings<T>);
130
+ } = settings || EMPTY_OBJECT;
131
131
  filter[CACHE] = filterChildren(
132
132
  filter.value as string,
133
133
  pathField,