@routier/core 0.2.1 → 0.3.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 (159) hide show
  1. package/LICENSE +21 -0
  2. package/{readme.md → README.md} +1 -1
  3. package/dist/assertions/index.cjs +191 -0
  4. package/dist/assertions/index.cjs.map +1 -0
  5. package/dist/assertions/index.js +43 -63
  6. package/dist/assertions/index.js.map +1 -1
  7. package/dist/capabilities/index.cjs +820 -0
  8. package/dist/capabilities/index.cjs.map +1 -0
  9. package/dist/capabilities/index.js +584 -558
  10. package/dist/capabilities/index.js.map +1 -1
  11. package/dist/codegen/handlers/CloneHandlerBuilder.d.ts +10 -1
  12. package/dist/codegen/handlers/clone/CloneArrayHandler.d.ts +3 -0
  13. package/dist/codegen/handlers/clone/CloneDateHandler.d.ts +13 -0
  14. package/dist/codegen/handlers/clone/CloneValueHandler.d.ts +16 -0
  15. package/dist/codegen/handlers/compare/CompareComputedHandler.d.ts +10 -0
  16. package/dist/codegen/handlers/compare/CompareFunctionHandler.d.ts +10 -0
  17. package/dist/codegen/handlers/deserialize/DeserializeArrayHandler.d.ts +14 -0
  18. package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingArrayHandler.d.ts +11 -0
  19. package/dist/codegen/handlers/enrichment/EnrichmentArrayHandler.d.ts +11 -0
  20. package/dist/codegen/handlers/freeze/FreezeArrayHandler.d.ts +6 -0
  21. package/dist/codegen/handlers/hash/HashArrayHandler.d.ts +10 -0
  22. package/dist/codegen/handlers/hash/HashFileHandler.d.ts +24 -0
  23. package/dist/codegen/handlers/hash/HashObjectHandler.d.ts +10 -0
  24. package/dist/codegen/handlers/hash/HashTransformHandler.d.ts +23 -0
  25. package/dist/codegen/handlers/merge/MergeArrayHandler.d.ts +20 -0
  26. package/dist/codegen/handlers/merge/MergeObjectHandler.d.ts +10 -0
  27. package/dist/codegen/handlers/serialize/SerializeArrayHandler.d.ts +19 -0
  28. package/dist/codegen/handlers/strip/StripComputedHandler.d.ts +10 -0
  29. package/dist/codegen/handlers/strip/StripFunctionHandler.d.ts +9 -0
  30. package/dist/codegen/handlers/types.d.ts +55 -1
  31. package/dist/codegen/index.cjs +618 -0
  32. package/dist/codegen/index.cjs.map +1 -0
  33. package/dist/codegen/index.js +99 -127
  34. package/dist/codegen/index.js.map +1 -1
  35. package/dist/collections/MemoryDataCollection.d.ts +15 -1
  36. package/dist/collections/TagCollection.d.ts +0 -1
  37. package/dist/collections/index.cjs +702 -0
  38. package/dist/collections/index.cjs.map +1 -0
  39. package/dist/collections/index.js +282 -276
  40. package/dist/collections/index.js.map +1 -1
  41. package/dist/errors/OptimisticConcurrencyError.d.ts +18 -0
  42. package/dist/errors/PluginDestroyedError.d.ts +10 -0
  43. package/dist/errors/index.cjs +132 -0
  44. package/dist/errors/index.cjs.map +1 -0
  45. package/dist/errors/index.d.ts +2 -0
  46. package/dist/errors/index.js +61 -19
  47. package/dist/errors/index.js.map +1 -1
  48. package/dist/expressions/evaluate.d.ts +53 -0
  49. package/dist/expressions/index.cjs +2087 -0
  50. package/dist/expressions/index.cjs.map +1 -0
  51. package/dist/expressions/index.d.ts +1 -1
  52. package/dist/expressions/index.js +1727 -1082
  53. package/dist/expressions/index.js.map +1 -1
  54. package/dist/expressions/parser.d.ts +19 -0
  55. package/dist/expressions/types.d.ts +87 -2
  56. package/dist/index.cjs +13925 -0
  57. package/dist/index.cjs.map +1 -0
  58. package/dist/index.js +11936 -7950
  59. package/dist/index.js.map +1 -1
  60. package/dist/performance/index.cjs +217 -0
  61. package/dist/performance/index.cjs.map +1 -0
  62. package/dist/performance/index.js +120 -55
  63. package/dist/performance/index.js.map +1 -1
  64. package/dist/pipeline/index.cjs +576 -0
  65. package/dist/pipeline/index.cjs.map +1 -0
  66. package/dist/pipeline/index.js +223 -161
  67. package/dist/pipeline/index.js.map +1 -1
  68. package/dist/plugins/BatchingDbPlugin.d.ts +139 -0
  69. package/dist/plugins/CacheDbPlugin.d.ts +70 -0
  70. package/dist/plugins/ConcurrencyDbPlugin.d.ts +78 -0
  71. package/dist/plugins/EphemeralDataPlugin.d.ts +57 -1
  72. package/dist/plugins/RetryDbPlugin.d.ts +77 -0
  73. package/dist/plugins/index.cjs +6104 -0
  74. package/dist/plugins/index.cjs.map +1 -0
  75. package/dist/plugins/index.d.ts +5 -0
  76. package/dist/plugins/index.js +5821 -1172
  77. package/dist/plugins/index.js.map +1 -1
  78. package/dist/plugins/query/QueryOptionsCollection.d.ts +21 -0
  79. package/dist/plugins/query/index.d.ts +2 -0
  80. package/dist/plugins/query/join.d.ts +210 -0
  81. package/dist/plugins/query/similarity.d.ts +38 -0
  82. package/dist/plugins/query/types.d.ts +64 -1
  83. package/dist/plugins/translators/DataTranslator.d.ts +28 -0
  84. package/dist/plugins/translators/JsonTranslator.d.ts +27 -0
  85. package/dist/plugins/translators/SqlTranslator.d.ts +45 -0
  86. package/dist/plugins/translators/TupleTranslator.d.ts +45 -0
  87. package/dist/plugins/translators/index.d.ts +1 -0
  88. package/dist/plugins/types.d.ts +82 -2
  89. package/dist/plugins/wire/handler.d.ts +122 -0
  90. package/dist/plugins/wire/index.d.ts +4 -0
  91. package/dist/plugins/wire/persist.d.ts +43 -0
  92. package/dist/plugins/wire/query.d.ts +49 -0
  93. package/dist/plugins/wire/types.d.ts +123 -0
  94. package/dist/results/index.cjs +174 -0
  95. package/dist/results/index.cjs.map +1 -0
  96. package/dist/results/index.js +29 -44
  97. package/dist/results/index.js.map +1 -1
  98. package/dist/schema/PropertyInfo.d.ts +31 -2
  99. package/dist/schema/SchemaDefinition.d.ts +23 -1
  100. package/dist/schema/builder.d.ts +35 -1
  101. package/dist/schema/communication/broadcast.d.ts +17 -1
  102. package/dist/schema/index.cjs +6911 -0
  103. package/dist/schema/index.cjs.map +1 -0
  104. package/dist/schema/index.d.ts +2 -0
  105. package/dist/schema/index.js +5330 -4541
  106. package/dist/schema/index.js.map +1 -1
  107. package/dist/schema/property/base/SchemaBase.d.ts +48 -2
  108. package/dist/schema/property/modifiers/SchemaNullable.d.ts +10 -0
  109. package/dist/schema/property/modifiers/SchemaOptional.d.ts +19 -0
  110. package/dist/schema/property/modifiers/SchemaSearchable.d.ts +34 -0
  111. package/dist/schema/property/modifiers/index.d.ts +1 -0
  112. package/dist/schema/property/types/SchemaFile.d.ts +60 -0
  113. package/dist/schema/property/types/SchemaString.d.ts +21 -1
  114. package/dist/schema/property/types/SchemaVector.d.ts +61 -0
  115. package/dist/schema/property/types/index.d.ts +2 -0
  116. package/dist/schema/table/SchemaTransform.d.ts +40 -0
  117. package/dist/schema/table/index.d.ts +1 -0
  118. package/dist/schema/types.d.ts +166 -8
  119. package/dist/schema/utils/propertyKind.d.ts +4 -0
  120. package/dist/types/index.cjs +23 -0
  121. package/dist/types/index.cjs.map +1 -0
  122. package/dist/types/index.js +0 -14
  123. package/dist/types/index.js.map +1 -1
  124. package/dist/utilities/index.cjs +982 -0
  125. package/dist/utilities/index.cjs.map +1 -0
  126. package/dist/utilities/index.js +506 -375
  127. package/dist/utilities/index.js.map +1 -1
  128. package/dist/utilities/logger.d.ts +48 -0
  129. package/package.json +152 -98
  130. package/dist/codegen/SlotPath.test.d.ts +0 -1
  131. package/dist/codegen/blocks.test.d.ts +0 -1
  132. package/dist/codegen/utils.test.d.ts +0 -1
  133. package/dist/collections/Changes.test.d.ts +0 -1
  134. package/dist/collections/IdSet.test.d.ts +0 -1
  135. package/dist/collections/MemoryDataCollection.test.d.ts +0 -1
  136. package/dist/collections/TagCollection.contract.test.d.ts +0 -1
  137. package/dist/collections/TagCollection.test.d.ts +0 -1
  138. package/dist/expressions/parser.test.d.ts +0 -1
  139. package/dist/expressions/sql.d.ts +0 -28
  140. package/dist/expressions/sql.test.d.ts +0 -1
  141. package/dist/expressions/utils.test.d.ts +0 -1
  142. package/dist/pipeline/SyncronousQueue.test.d.ts +0 -1
  143. package/dist/plugins/EphemeralDataPlugin.test.d.ts +0 -1
  144. package/dist/plugins/query/Query.test.d.ts +0 -1
  145. package/dist/plugins/query/QueryOptionsCollection.test.d.ts +0 -1
  146. package/dist/plugins/translators/JsonTranslator.test.d.ts +0 -1
  147. package/dist/plugins/translators/SqlTranslator.test.d.ts +0 -1
  148. package/dist/plugins/translators/TranslatedValues.test.d.ts +0 -1
  149. package/dist/results/Result.test.d.ts +0 -1
  150. package/dist/results/utils.test.d.ts +0 -1
  151. package/dist/schema/PropertyInfo.test.d.ts +0 -1
  152. package/dist/schema/communication/broadcast.test.d.ts +0 -1
  153. package/dist/schema/schemaGeneration.test.d.ts +0 -1
  154. package/dist/schema/utils/standardJsonSchema.test.d.ts +0 -1
  155. package/dist/utilities/arrays.test.d.ts +0 -1
  156. package/dist/utilities/dates.test.d.ts +0 -1
  157. package/dist/utilities/runtime.test.d.ts +0 -1
  158. package/dist/utilities/strings.test.d.ts +0 -1
  159. package/dist/utilities/uuid.test.d.ts +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 James DeMeuse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -44,7 +44,7 @@ class AppContext extends DataStore {
44
44
  constructor() {
45
45
  super(new MemoryPlugin("routier-app"));
46
46
  }
47
- users = this.collection(userSchema).create();
47
+ users = this.collection(userSchema).proxy().create();
48
48
  }
49
49
 
50
50
  const ctx = new AppContext();
@@ -0,0 +1,191 @@
1
+ (() => {
2
+ "use strict";
3
+ var __webpack_modules__ = ({
4
+ 835(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
5
+ __webpack_require__.d(__webpack_exports__, {
6
+ t: () => (EXPRESSION_TYPES)
7
+ });
8
+ const EXPRESSION_TYPES = [
9
+ "operator",
10
+ "comparator",
11
+ "property",
12
+ "value",
13
+ "empty",
14
+ "not-parsable"
15
+ ];
16
+
17
+
18
+ },
19
+ 76(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
20
+ __webpack_require__.d(__webpack_exports__, {
21
+ $: () => (isDate)
22
+ });
23
+ const isDate = (data)=>{
24
+ if (data == null) {
25
+ return false;
26
+ }
27
+ if (typeof data !== "object") {
28
+ return false;
29
+ }
30
+ return data instanceof Date;
31
+ };
32
+
33
+
34
+ },
35
+
36
+ });
37
+ // The module cache
38
+ var __webpack_module_cache__ = {};
39
+
40
+ // The require function
41
+ function __webpack_require__(moduleId) {
42
+
43
+ // Check if module is in cache
44
+ var cachedModule = __webpack_module_cache__[moduleId];
45
+ if (cachedModule !== undefined) {
46
+ return cachedModule.exports;
47
+ }
48
+ // Create a new module (and put it into the cache)
49
+ var module = (__webpack_module_cache__[moduleId] = {
50
+ exports: {}
51
+ });
52
+ // Execute the module function
53
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
54
+
55
+ // Return the exports of the module
56
+ return module.exports;
57
+
58
+ }
59
+
60
+ // webpack/runtime/define_property_getters
61
+ (() => {
62
+ __webpack_require__.d = (exports, definition) => {
63
+ for(var key in definition) {
64
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
65
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
66
+ }
67
+ }
68
+ };
69
+ })();
70
+ // webpack/runtime/has_own_property
71
+ (() => {
72
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
73
+ })();
74
+ // webpack/runtime/make_namespace_object
75
+ (() => {
76
+ // define __esModule on exports
77
+ __webpack_require__.r = (exports) => {
78
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
79
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
80
+ }
81
+ Object.defineProperty(exports, '__esModule', { value: true });
82
+ };
83
+ })();
84
+ var __webpack_exports__ = {};
85
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
86
+ (() => {
87
+ __webpack_require__.r(__webpack_exports__);
88
+ __webpack_require__.d(__webpack_exports__, {
89
+ assertDate: () => (assertDate),
90
+ assertInstanceOf: () => (assertInstanceOf),
91
+ assertIsArray: () => (assertIsArray),
92
+ assertIsNotNull: () => (assertIsNotNull),
93
+ assertIsNumber: () => (assertIsNumber),
94
+ assertString: () => (assertString),
95
+ isComparatorExpression: () => (isComparatorExpression),
96
+ isEmptyExpression: () => (isEmptyExpression),
97
+ isExpression: () => (isExpression),
98
+ isNotParsableExpression: () => (isNotParsableExpression),
99
+ isOperatorExpression: () => (isOperatorExpression),
100
+ isPropertyExpression: () => (isPropertyExpression),
101
+ isValueExpression: () => (isValueExpression)
102
+ });
103
+ /* import */ var _expressions_constants__rspack_import_1 = __webpack_require__(835);
104
+ /* import */ var _utilities__rspack_import_0 = __webpack_require__(76);
105
+
106
+
107
+ function assertDate(data) {
108
+ if ((0,_utilities__rspack_import_0/* .isDate */.$)(data) === false) {
109
+ throw new TypeError('Value is not a Date');
110
+ }
111
+ }
112
+ function assertIsNotNull(data, message) {
113
+ if (data == null) {
114
+ if (message == null) {
115
+ throw new TypeError('Assertion failed, data is null');
116
+ }
117
+ if (typeof message === "string") {
118
+ throw new TypeError(message);
119
+ }
120
+ throw new TypeError(message());
121
+ }
122
+ }
123
+ function assertIsArray(data, message) {
124
+ if (!Array.isArray(data)) {
125
+ throw new TypeError(message ?? 'Assertion failed, data is not of type Array');
126
+ }
127
+ }
128
+ function assertString(data, message) {
129
+ if (typeof data !== "string") {
130
+ throw new TypeError(message ?? 'Assertion failed, data is not of type String');
131
+ }
132
+ }
133
+ function assertInstanceOf(value, Instance) {
134
+ if (value instanceof Instance) {
135
+ return;
136
+ }
137
+ if (value != null && typeof value === "object" && "constructor" in value) {
138
+ throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);
139
+ }
140
+ throw new TypeError(`value is not instance of type`);
141
+ }
142
+ function assertIsNumber(value) {
143
+ if (typeof value !== "number") {
144
+ throw new TypeError("value is not of type `number`");
145
+ }
146
+ }
147
+ function isObjectWithType(value) {
148
+ return typeof value === "object" && value !== null && "type" in value;
149
+ }
150
+ /**
151
+ * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.
152
+ */ function isExpression(value) {
153
+ return isObjectWithType(value) && _expressions_constants__rspack_import_1/* .EXPRESSION_TYPES.includes */.t.includes(value.type);
154
+ }
155
+ /**
156
+ * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === "operator"`.
157
+ */ function isOperatorExpression(value) {
158
+ return isObjectWithType(value) && value.type === "operator";
159
+ }
160
+ /**
161
+ * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === "comparator"`.
162
+ */ function isComparatorExpression(value) {
163
+ return isObjectWithType(value) && value.type === "comparator";
164
+ }
165
+ /**
166
+ * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === "property"`.
167
+ */ function isPropertyExpression(value) {
168
+ return isObjectWithType(value) && value.type === "property";
169
+ }
170
+ /**
171
+ * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === "value"`.
172
+ */ function isValueExpression(value) {
173
+ return isObjectWithType(value) && value.type === "value";
174
+ }
175
+ /**
176
+ * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === "empty"`.
177
+ */ function isEmptyExpression(value) {
178
+ return isObjectWithType(value) && value.type === "empty";
179
+ }
180
+ /**
181
+ * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === "not-parsable"`.
182
+ */ function isNotParsableExpression(value) {
183
+ return isObjectWithType(value) && value.type === "not-parsable";
184
+ }
185
+
186
+ })();
187
+
188
+ module.exports = __webpack_exports__;
189
+ })()
190
+ ;
191
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions/index.cjs","sources":["webpack://@routier/core/./src/expressions/constants.ts","webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/assertions/index.ts"],"sourcesContent":["import { ExpressionType } from \"./types\";\n\nexport const EXPRESSION_TYPES: ExpressionType[] = [\n \"operator\",\n \"comparator\",\n \"property\",\n \"value\",\n \"empty\",\n \"not-parsable\",\n];\n","export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { EXPRESSION_TYPES } from \"../expressions/constants\";\nimport { ComparatorExpression, EmptyExpression, Expression, ExpressionType, NotParsableExpression, OperatorExpression, PropertyExpression, ValueExpression } from \"../expressions/types\";\nimport { isDate } from \"../utilities\";\n\nexport function assertDate(data: unknown): asserts data is Date {\n if (isDate(data) === false) {\n throw new TypeError('Value is not a Date');\n }\n}\n\nexport function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T> {\n if (data == null) {\n if (message == null) {\n throw new TypeError('Assertion failed, data is null');\n }\n\n if (typeof message === \"string\") {\n throw new TypeError(message);\n }\n\n throw new TypeError(message());\n }\n}\n\nexport function assertIsArray<T>(data: unknown, message?: string): asserts data is T[] {\n if (!Array.isArray(data)) {\n throw new TypeError(message ?? 'Assertion failed, data is not of type Array');\n }\n}\n\nexport function assertString(data: unknown, message?: string): asserts data is string {\n if (typeof data !== \"string\") {\n throw new TypeError(message ?? 'Assertion failed, data is not of type String');\n }\n}\n\nexport function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T {\n if (value instanceof Instance) {\n return;\n }\n\n if (value != null && typeof value === \"object\" && \"constructor\" in value) {\n throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);\n }\n\n throw new TypeError(`value is not instance of type`);\n}\n\nexport function assertIsNumber(value: unknown): asserts value is number {\n if (typeof value !== \"number\") {\n throw new TypeError(\"value is not of type `number`\");\n }\n}\n\n\nfunction isObjectWithType(value: unknown): value is Record<\"type\", unknown> {\n return typeof value === \"object\" && value !== null && \"type\" in value;\n}\n\n/**\n * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.\n */\nexport function isExpression(value: unknown): value is Expression {\n return isObjectWithType(value) && EXPRESSION_TYPES.includes(value.type as ExpressionType);\n}\n\n/**\n * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === \"operator\"`.\n */\nexport function isOperatorExpression(value: unknown): value is OperatorExpression {\n return isObjectWithType(value) && value.type === \"operator\";\n}\n\n/**\n * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === \"comparator\"`.\n */\nexport function isComparatorExpression(value: unknown): value is ComparatorExpression {\n return isObjectWithType(value) && value.type === \"comparator\";\n}\n\n/**\n * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === \"property\"`.\n */\nexport function isPropertyExpression(value: unknown): value is PropertyExpression {\n return isObjectWithType(value) && value.type === \"property\";\n}\n\n/**\n * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === \"value\"`.\n */\nexport function isValueExpression(value: unknown): value is ValueExpression {\n return isObjectWithType(value) && value.type === \"value\";\n}\n\n/**\n * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === \"empty\"`.\n */\nexport function isEmptyExpression(value: unknown): value is EmptyExpression {\n return isObjectWithType(value) && value.type === \"empty\";\n}\n\n/**\n * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === \"not-parsable\"`.\n */\nexport function isNotParsableExpression(value: unknown): value is NotParsableExpression {\n return isObjectWithType(value) && value.type === \"not-parsable\";\n}"],"names":["EXPRESSION_TYPES","isDate","data","Date","assertDate","TypeError","assertIsNotNull","message","assertIsArray","Array","assertString","assertInstanceOf","value","Instance","assertIsNumber","isObjectWithType","isExpression","isOperatorExpression","isComparatorExpression","isPropertyExpression","isValueExpression","isEmptyExpression","isNotParsableExpression"],"mappings":";;;;;;;AAEO,MAAMA,mBAAqC;IAC9C;IACA;IACA;IACA;IACA;IACA;CACH,CAAC;;;;;;;;ACTK,MAAMC,SAAS,CAACC;IACnB,IAAIA,QAAQ,MAAM;QACd,OAAO;IACX;IAEA,IAAI,OAAOA,SAAS,UAAU;QAC1B,OAAO;IACX;IAEA,OAAOA,gBAAgBC;AAC3B,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;;;;;;;;;;;ACN4D;AAEtB;AAE/B,SAASC,WAAWF,IAAa;IACpC,IAAID,8CAAMA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ACjD,OAAOG,iBAAiBH,UAAUA,MAAM,IAAI,KAAK;AACrD;AAEA;;CAEC,GACM,SAASO,qBAAqBP,KAAc;IAC/C,OAAOG,iBAAiBH,UAAUA,MAAM,IAAI,KAAK;AACrD;AAEA;;CAEC,GACM,SAASQ,kBAAkBR,KAAc;IAC5C,OAAOG,iBAAiBH,UAAUA,MAAM,IAAI,KAAK;AACrD;AAEA;;CAEC,GACM,SAASS,kBAAkBT,KAAc;IAC5C,OAAOG,iBAAiBH,UAAUA,MAAM,IAAI,KAAK;AACrD;AAEA;;CAEC,GACM,SAASU,wBAAwBV,KAAc;IAClD,OAAOG,iBAAiBH,UAAUA,MAAM,IAAI,KAAK;AACrD"}
@@ -1,8 +1,7 @@
1
1
  var __webpack_modules__ = ({
2
- "./src/expressions/constants.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
3
- __webpack_require__.r(__webpack_exports__);
2
+ 835(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
4
3
  __webpack_require__.d(__webpack_exports__, {
5
- EXPRESSION_TYPES: () => (EXPRESSION_TYPES)
4
+ t: () => (EXPRESSION_TYPES)
6
5
  });
7
6
  const EXPRESSION_TYPES = [
8
7
  "operator",
@@ -10,17 +9,16 @@ const EXPRESSION_TYPES = [
10
9
  "property",
11
10
  "value",
12
11
  "empty",
13
- "not-parsable",
12
+ "not-parsable"
14
13
  ];
15
14
 
16
15
 
17
16
  },
18
- "./src/utilities/dates.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
19
- __webpack_require__.r(__webpack_exports__);
17
+ 76(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
20
18
  __webpack_require__.d(__webpack_exports__, {
21
- isDate: () => (isDate)
19
+ $: () => (isDate)
22
20
  });
23
- const isDate = (data) => {
21
+ const isDate = (data)=>{
24
22
  if (data == null) {
25
23
  return false;
26
24
  }
@@ -71,41 +69,30 @@ __webpack_require__.d = (exports, definition) => {
71
69
  (() => {
72
70
  __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
73
71
  })();
74
- // webpack/runtime/make_namespace_object
75
- (() => {
76
- // define __esModule on exports
77
- __webpack_require__.r = (exports) => {
78
- if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
79
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
80
- }
81
- Object.defineProperty(exports, '__esModule', { value: true });
82
- };
83
- })();
84
72
  var __webpack_exports__ = {};
85
73
  // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
86
74
  (() => {
87
- __webpack_require__.r(__webpack_exports__);
88
75
  __webpack_require__.d(__webpack_exports__, {
89
- assertDate: () => (assertDate),
90
- assertInstanceOf: () => (assertInstanceOf),
91
- assertIsArray: () => (assertIsArray),
92
- assertIsNotNull: () => (assertIsNotNull),
93
- assertIsNumber: () => (assertIsNumber),
94
- assertString: () => (assertString),
95
- isComparatorExpression: () => (isComparatorExpression),
96
- isEmptyExpression: () => (isEmptyExpression),
97
- isExpression: () => (isExpression),
98
- isNotParsableExpression: () => (isNotParsableExpression),
99
- isOperatorExpression: () => (isOperatorExpression),
100
- isPropertyExpression: () => (isPropertyExpression),
101
- isValueExpression: () => (isValueExpression)
76
+ AF: () => (isNotParsableExpression),
77
+ BH: () => (isExpression),
78
+ Cv: () => (assertString),
79
+ S6: () => (isValueExpression),
80
+ Ye: () => (assertIsNumber),
81
+ dp: () => (assertDate),
82
+ e3: () => (isPropertyExpression),
83
+ jf: () => (assertIsNotNull),
84
+ nn: () => (assertInstanceOf),
85
+ vg: () => (isOperatorExpression),
86
+ wL: () => (isEmptyExpression),
87
+ xH: () => (isComparatorExpression),
88
+ ys: () => (assertIsArray)
102
89
  });
103
- /* import */ var _expressions_constants__rspack_import_1 = __webpack_require__("./src/expressions/constants.ts");
104
- /* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/dates.ts");
90
+ /* import */ var _expressions_constants__rspack_import_1 = __webpack_require__(835);
91
+ /* import */ var _utilities__rspack_import_0 = __webpack_require__(76);
105
92
 
106
93
 
107
94
  function assertDate(data) {
108
- if ((0,_utilities__rspack_import_0.isDate)(data) === false) {
95
+ if ((0,_utilities__rspack_import_0/* .isDate */.$)(data) === false) {
109
96
  throw new TypeError('Value is not a Date');
110
97
  }
111
98
  }
@@ -149,62 +136,55 @@ function isObjectWithType(value) {
149
136
  }
150
137
  /**
151
138
  * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.
152
- */
153
- function isExpression(value) {
154
- return isObjectWithType(value) && _expressions_constants__rspack_import_1.EXPRESSION_TYPES.includes(value.type);
139
+ */ function isExpression(value) {
140
+ return isObjectWithType(value) && _expressions_constants__rspack_import_1/* .EXPRESSION_TYPES.includes */.t.includes(value.type);
155
141
  }
156
142
  /**
157
143
  * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === "operator"`.
158
- */
159
- function isOperatorExpression(value) {
144
+ */ function isOperatorExpression(value) {
160
145
  return isObjectWithType(value) && value.type === "operator";
161
146
  }
162
147
  /**
163
148
  * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === "comparator"`.
164
- */
165
- function isComparatorExpression(value) {
149
+ */ function isComparatorExpression(value) {
166
150
  return isObjectWithType(value) && value.type === "comparator";
167
151
  }
168
152
  /**
169
153
  * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === "property"`.
170
- */
171
- function isPropertyExpression(value) {
154
+ */ function isPropertyExpression(value) {
172
155
  return isObjectWithType(value) && value.type === "property";
173
156
  }
174
157
  /**
175
158
  * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === "value"`.
176
- */
177
- function isValueExpression(value) {
159
+ */ function isValueExpression(value) {
178
160
  return isObjectWithType(value) && value.type === "value";
179
161
  }
180
162
  /**
181
163
  * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === "empty"`.
182
- */
183
- function isEmptyExpression(value) {
164
+ */ function isEmptyExpression(value) {
184
165
  return isObjectWithType(value) && value.type === "empty";
185
166
  }
186
167
  /**
187
168
  * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === "not-parsable"`.
188
- */
189
- function isNotParsableExpression(value) {
169
+ */ function isNotParsableExpression(value) {
190
170
  return isObjectWithType(value) && value.type === "not-parsable";
191
171
  }
192
172
 
193
173
  })();
194
174
 
195
- var __webpack_exports__assertDate = __webpack_exports__.assertDate;
196
- var __webpack_exports__assertInstanceOf = __webpack_exports__.assertInstanceOf;
197
- var __webpack_exports__assertIsArray = __webpack_exports__.assertIsArray;
198
- var __webpack_exports__assertIsNotNull = __webpack_exports__.assertIsNotNull;
199
- var __webpack_exports__assertIsNumber = __webpack_exports__.assertIsNumber;
200
- var __webpack_exports__assertString = __webpack_exports__.assertString;
201
- var __webpack_exports__isComparatorExpression = __webpack_exports__.isComparatorExpression;
202
- var __webpack_exports__isEmptyExpression = __webpack_exports__.isEmptyExpression;
203
- var __webpack_exports__isExpression = __webpack_exports__.isExpression;
204
- var __webpack_exports__isNotParsableExpression = __webpack_exports__.isNotParsableExpression;
205
- var __webpack_exports__isOperatorExpression = __webpack_exports__.isOperatorExpression;
206
- var __webpack_exports__isPropertyExpression = __webpack_exports__.isPropertyExpression;
207
- var __webpack_exports__isValueExpression = __webpack_exports__.isValueExpression;
175
+ var __webpack_exports__assertDate = __webpack_exports__.dp;
176
+ var __webpack_exports__assertInstanceOf = __webpack_exports__.nn;
177
+ var __webpack_exports__assertIsArray = __webpack_exports__.ys;
178
+ var __webpack_exports__assertIsNotNull = __webpack_exports__.jf;
179
+ var __webpack_exports__assertIsNumber = __webpack_exports__.Ye;
180
+ var __webpack_exports__assertString = __webpack_exports__.Cv;
181
+ var __webpack_exports__isComparatorExpression = __webpack_exports__.xH;
182
+ var __webpack_exports__isEmptyExpression = __webpack_exports__.wL;
183
+ var __webpack_exports__isExpression = __webpack_exports__.BH;
184
+ var __webpack_exports__isNotParsableExpression = __webpack_exports__.AF;
185
+ var __webpack_exports__isOperatorExpression = __webpack_exports__.vg;
186
+ var __webpack_exports__isPropertyExpression = __webpack_exports__.e3;
187
+ var __webpack_exports__isValueExpression = __webpack_exports__.S6;
208
188
  export { __webpack_exports__assertDate as assertDate, __webpack_exports__assertInstanceOf as assertInstanceOf, __webpack_exports__assertIsArray as assertIsArray, __webpack_exports__assertIsNotNull as assertIsNotNull, __webpack_exports__assertIsNumber as assertIsNumber, __webpack_exports__assertString as assertString, __webpack_exports__isComparatorExpression as isComparatorExpression, __webpack_exports__isEmptyExpression as isEmptyExpression, __webpack_exports__isExpression as isExpression, __webpack_exports__isNotParsableExpression as isNotParsableExpression, __webpack_exports__isOperatorExpression as isOperatorExpression, __webpack_exports__isPropertyExpression as isPropertyExpression, __webpack_exports__isValueExpression as isValueExpression };
209
189
 
210
190
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertions/index.js","sources":["webpack://@routier/core/./src/expressions/constants.ts","webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/assertions/index.ts"],"sourcesContent":["import { ExpressionType } from \"./types\";\n\nexport const EXPRESSION_TYPES: ExpressionType[] = [\n \"operator\",\n \"comparator\",\n \"property\",\n \"value\",\n \"empty\",\n \"not-parsable\",\n];\n","export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { EXPRESSION_TYPES } from \"../expressions/constants\";\nimport { ComparatorExpression, EmptyExpression, Expression, ExpressionType, NotParsableExpression, OperatorExpression, PropertyExpression, ValueExpression } from \"../expressions/types\";\nimport { isDate } from \"../utilities\";\n\nexport function assertDate(data: unknown): asserts data is Date {\n if (isDate(data) === false) {\n throw new TypeError('Value is not a Date');\n }\n}\n\nexport function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T> {\n if (data == null) {\n if (message == null) {\n throw new TypeError('Assertion failed, data is null');\n }\n\n if (typeof message === \"string\") {\n throw new TypeError(message);\n }\n\n throw new TypeError(message());\n }\n}\n\nexport function assertIsArray<T>(data: unknown, message?: string): asserts data is T[] {\n if (!Array.isArray(data)) {\n throw new TypeError(message ?? 'Assertion failed, data is not of type Array');\n }\n}\n\nexport function assertString(data: unknown, message?: string): asserts data is string {\n if (typeof data !== \"string\") {\n throw new TypeError(message ?? 'Assertion failed, data is not of type String');\n }\n}\n\nexport function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T {\n if (value instanceof Instance) {\n return;\n }\n\n if (value != null && typeof value === \"object\" && \"constructor\" in value) {\n throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);\n }\n\n throw new TypeError(`value is not instance of type`);\n}\n\nexport function assertIsNumber(value: unknown): asserts value is number {\n if (typeof value !== \"number\") {\n throw new TypeError(\"value is not of type `number`\");\n }\n}\n\n\nfunction isObjectWithType(value: unknown): value is Record<\"type\", unknown> {\n return typeof value === \"object\" && value !== null && \"type\" in value;\n}\n\n/**\n * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.\n */\nexport function isExpression(value: unknown): value is Expression {\n return isObjectWithType(value) && EXPRESSION_TYPES.includes(value.type as ExpressionType);\n}\n\n/**\n * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === \"operator\"`.\n */\nexport function isOperatorExpression(value: unknown): value is OperatorExpression {\n return isObjectWithType(value) && value.type === \"operator\";\n}\n\n/**\n * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === \"comparator\"`.\n */\nexport function isComparatorExpression(value: unknown): value is ComparatorExpression {\n return isObjectWithType(value) && value.type === \"comparator\";\n}\n\n/**\n * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === \"property\"`.\n */\nexport function isPropertyExpression(value: unknown): value is PropertyExpression {\n return isObjectWithType(value) && value.type === \"property\";\n}\n\n/**\n * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === \"value\"`.\n */\nexport function isValueExpression(value: unknown): value is ValueExpression {\n return isObjectWithType(value) && value.type === \"value\";\n}\n\n/**\n * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === \"empty\"`.\n */\nexport function isEmptyExpression(value: unknown): value is EmptyExpression {\n return isObjectWithType(value) && value.type === \"empty\";\n}\n\n/**\n * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === \"not-parsable\"`.\n */\nexport function isNotParsableExpression(value: unknown): value is NotParsableExpression {\n return isObjectWithType(value) && value.type === \"not-parsable\";\n}"],"names":[],"mappings":";;;;;;AAEO,MAAM,gBAAgB,GAAqB;IAC9C,UAAU;IACV,YAAY;IACZ,UAAU;IACV,OAAO;IACP,OAAO;IACP,cAAc;CACjB,CAAC;;;;;;;;;ACTK,MAAM,MAAM,GAAG,CAAC,IAAa,EAAgB,EAAE;IAClD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,YAAY,IAAI,CAAC;AAChC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACx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AO,CAAC;AAC7D,CAAC;AAED;;GAEG;AACI,SAAS,uBAAuB,CAAC,KAAc;IAClD,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;AACpE,CAAC"}
1
+ {"version":3,"file":"assertions/index.js","sources":["webpack://@routier/core/./src/expressions/constants.ts","webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/./src/assertions/index.ts"],"sourcesContent":["import { ExpressionType } from \"./types\";\n\nexport const EXPRESSION_TYPES: ExpressionType[] = [\n \"operator\",\n \"comparator\",\n \"property\",\n \"value\",\n \"empty\",\n \"not-parsable\",\n];\n","export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { EXPRESSION_TYPES } from \"../expressions/constants\";\nimport { ComparatorExpression, EmptyExpression, Expression, ExpressionType, NotParsableExpression, OperatorExpression, PropertyExpression, ValueExpression } from \"../expressions/types\";\nimport { isDate } from \"../utilities\";\n\nexport function assertDate(data: unknown): asserts data is Date {\n if (isDate(data) === false) {\n throw new TypeError('Value is not a Date');\n }\n}\n\nexport function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T> {\n if (data == null) {\n if (message == null) {\n throw new TypeError('Assertion failed, data is null');\n }\n\n if (typeof message === \"string\") {\n throw new TypeError(message);\n }\n\n throw new TypeError(message());\n }\n}\n\nexport function assertIsArray<T>(data: unknown, message?: string): asserts data is T[] {\n if (!Array.isArray(data)) {\n throw new TypeError(message ?? 'Assertion failed, data is not of type Array');\n }\n}\n\nexport function assertString(data: unknown, message?: string): asserts data is string {\n if (typeof data !== \"string\") {\n throw new TypeError(message ?? 'Assertion failed, data is not of type String');\n }\n}\n\nexport function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T {\n if (value instanceof Instance) {\n return;\n }\n\n if (value != null && typeof value === \"object\" && \"constructor\" in value) {\n throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);\n }\n\n throw new TypeError(`value is not instance of type`);\n}\n\nexport function assertIsNumber(value: unknown): asserts value is number {\n if (typeof value !== \"number\") {\n throw new TypeError(\"value is not of type `number`\");\n }\n}\n\n\nfunction isObjectWithType(value: unknown): value is Record<\"type\", unknown> {\n return typeof value === \"object\" && value !== null && \"type\" in value;\n}\n\n/**\n * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.\n */\nexport function isExpression(value: unknown): value is Expression {\n return isObjectWithType(value) && EXPRESSION_TYPES.includes(value.type as ExpressionType);\n}\n\n/**\n * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === \"operator\"`.\n */\nexport function isOperatorExpression(value: unknown): value is OperatorExpression {\n return isObjectWithType(value) && value.type === \"operator\";\n}\n\n/**\n * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === \"comparator\"`.\n */\nexport function isComparatorExpression(value: unknown): value is ComparatorExpression {\n return isObjectWithType(value) && value.type === \"comparator\";\n}\n\n/**\n * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === \"property\"`.\n */\nexport function isPropertyExpression(value: unknown): value is PropertyExpression {\n return isObjectWithType(value) && value.type === \"property\";\n}\n\n/**\n * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === \"value\"`.\n */\nexport function isValueExpression(value: unknown): value is ValueExpression {\n return isObjectWithType(value) && value.type === \"value\";\n}\n\n/**\n * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === \"empty\"`.\n */\nexport function isEmptyExpression(value: unknown): value is EmptyExpression {\n return isObjectWithType(value) && value.type === \"empty\";\n}\n\n/**\n * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === \"not-parsable\"`.\n */\nexport function isNotParsableExpression(value: unknown): value is NotParsableExpression {\n return isObjectWithType(value) && value.type === \"not-parsable\";\n}"],"names":["EXPRESSION_TYPES","isDate","data","Date","assertDate","TypeError","assertIsNotNull","message","assertIsArray","Array","assertString","assertInstanceOf","value","Instance","assertIsNumber","isObjectWithType","isExpression","isOperatorExpression","isComparatorExpression","isPropertyExpression","isValueExpression","isEmptyExpression","isNotParsableExpression"],"mappings":";;;;;AAEO,MAAMA,mBAAqC;IAC9C;IACA;IACA;IACA;IACA;IACA;CACH,CAAC;;;;;;;;ACTK,MAAMC,SAAS,CAACC;IACnB,IAAIA,QAAQ,MAAM;QACd,OAAO;IACX;IAEA,IAAI,OAAOA,SAAS,UAAU;QAC1B,OAAO;IACX;IAEA,OAAOA,gBAAgBC;AAC3B,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;;;;;;;;;;;;;;;;;;;ACA4D;AAEtB;AAE/B,SAASC,WAAWF,IAAa;IACpC,IAAID,8CAAMA,CAACC,UAAU,OAAO;QACxB,MAAM,IAAIG,UAAU;IACxB;AACJ;AAEO,SAASC,gBAAmBJ,IAA0B,EAAEK,OAAiC;IAC5F,IAAIL,QAAQ,MAAM;QACd,IAAIK,WAAW,MAAM;YACjB,MAAM,IAAIF,UAAU;QACxB;QAEA,IAAI,OAAOE,YAAY,UAAU;YAC7B,MAAM,IAAIF,UAAUE;QACxB;QAEA,MAAM,IAAIF,UAAUE;IACxB;AACJ;AAEO,SAASC,cAAiBN,IAAa,EAAEK,OAAgB;IAC5D,IAAI,CAACE,MAAM,OAAO,CAACP,OAAO;QACtB,MAAM,IAAIG,UAAUE,WAAW;IACnC;AACJ;AAEO,SAASG,aAAaR,IAAa,EAAEK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