@mikro-orm/core 7.0.0-dev.0 → 7.0.0-dev.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.
Files changed (261) hide show
  1. package/EntityManager.d.ts +18 -13
  2. package/EntityManager.js +202 -202
  3. package/MikroORM.d.ts +7 -6
  4. package/MikroORM.js +33 -45
  5. package/cache/CacheAdapter.js +1 -2
  6. package/cache/FileCacheAdapter.d.ts +1 -1
  7. package/cache/FileCacheAdapter.js +18 -26
  8. package/cache/GeneratedCacheAdapter.d.ts +2 -2
  9. package/cache/GeneratedCacheAdapter.js +1 -5
  10. package/cache/MemoryCacheAdapter.d.ts +1 -1
  11. package/cache/MemoryCacheAdapter.js +1 -5
  12. package/cache/NullCacheAdapter.d.ts +1 -1
  13. package/cache/NullCacheAdapter.js +1 -5
  14. package/cache/index.d.ts +5 -5
  15. package/cache/index.js +5 -21
  16. package/connections/Connection.d.ts +7 -7
  17. package/connections/Connection.js +8 -12
  18. package/connections/index.d.ts +1 -1
  19. package/connections/index.js +1 -17
  20. package/decorators/Check.d.ts +1 -1
  21. package/decorators/Check.js +5 -8
  22. package/decorators/CreateRequestContext.d.ts +1 -1
  23. package/decorators/CreateRequestContext.js +9 -13
  24. package/decorators/Embeddable.d.ts +1 -1
  25. package/decorators/Embeddable.js +3 -6
  26. package/decorators/Embedded.d.ts +1 -1
  27. package/decorators/Embedded.js +10 -12
  28. package/decorators/Entity.d.ts +2 -2
  29. package/decorators/Entity.js +5 -8
  30. package/decorators/Enum.d.ts +2 -2
  31. package/decorators/Enum.js +7 -10
  32. package/decorators/Filter.d.ts +1 -1
  33. package/decorators/Filter.js +3 -6
  34. package/decorators/Formula.d.ts +2 -2
  35. package/decorators/Formula.js +7 -10
  36. package/decorators/Indexed.d.ts +2 -2
  37. package/decorators/Indexed.js +6 -10
  38. package/decorators/ManyToMany.d.ts +3 -3
  39. package/decorators/ManyToMany.js +10 -12
  40. package/decorators/ManyToOne.d.ts +3 -3
  41. package/decorators/ManyToOne.js +10 -12
  42. package/decorators/OneToMany.d.ts +3 -3
  43. package/decorators/OneToMany.js +11 -14
  44. package/decorators/OneToOne.d.ts +4 -4
  45. package/decorators/OneToOne.js +4 -7
  46. package/decorators/PrimaryKey.d.ts +2 -2
  47. package/decorators/PrimaryKey.js +10 -13
  48. package/decorators/Property.d.ts +5 -5
  49. package/decorators/Property.js +10 -12
  50. package/decorators/Transactional.d.ts +2 -2
  51. package/decorators/Transactional.js +7 -10
  52. package/decorators/hooks.js +23 -35
  53. package/decorators/index.d.ts +17 -17
  54. package/decorators/index.js +17 -36
  55. package/drivers/DatabaseDriver.d.ts +13 -12
  56. package/drivers/DatabaseDriver.js +60 -64
  57. package/drivers/IDatabaseDriver.d.ts +12 -12
  58. package/drivers/IDatabaseDriver.js +1 -4
  59. package/drivers/index.d.ts +2 -2
  60. package/drivers/index.js +2 -18
  61. package/entity/ArrayCollection.d.ts +2 -2
  62. package/entity/ArrayCollection.js +29 -33
  63. package/entity/BaseEntity.d.ts +6 -6
  64. package/entity/BaseEntity.js +17 -21
  65. package/entity/Collection.d.ts +6 -6
  66. package/entity/Collection.js +40 -44
  67. package/entity/EntityAssigner.d.ts +2 -2
  68. package/entity/EntityAssigner.js +58 -63
  69. package/entity/EntityFactory.d.ts +3 -3
  70. package/entity/EntityFactory.js +58 -62
  71. package/entity/EntityHelper.d.ts +2 -2
  72. package/entity/EntityHelper.js +41 -45
  73. package/entity/EntityIdentifier.d.ts +1 -1
  74. package/entity/EntityIdentifier.js +1 -5
  75. package/entity/EntityLoader.d.ts +5 -5
  76. package/entity/EntityLoader.js +92 -96
  77. package/entity/EntityRepository.d.ts +7 -7
  78. package/entity/EntityRepository.js +7 -11
  79. package/entity/EntityValidator.d.ts +1 -1
  80. package/entity/EntityValidator.js +25 -29
  81. package/entity/Reference.d.ts +2 -2
  82. package/entity/Reference.js +35 -42
  83. package/entity/WrappedEntity.d.ts +12 -12
  84. package/entity/WrappedEntity.js +23 -27
  85. package/entity/index.d.ts +13 -13
  86. package/entity/index.js +13 -29
  87. package/entity/utils.d.ts +1 -1
  88. package/entity/utils.js +9 -12
  89. package/entity/wrap.d.ts +1 -1
  90. package/entity/wrap.js +2 -6
  91. package/enums.d.ts +3 -3
  92. package/enums.js +37 -41
  93. package/errors.d.ts +1 -1
  94. package/errors.js +15 -24
  95. package/events/EventManager.d.ts +3 -3
  96. package/events/EventManager.js +8 -12
  97. package/events/EventSubscriber.d.ts +5 -4
  98. package/events/EventSubscriber.js +1 -2
  99. package/events/TransactionEventBroadcaster.d.ts +3 -3
  100. package/events/TransactionEventBroadcaster.js +1 -5
  101. package/events/index.d.ts +3 -3
  102. package/events/index.js +3 -19
  103. package/exceptions.js +18 -39
  104. package/hydration/Hydrator.d.ts +5 -5
  105. package/hydration/Hydrator.js +3 -6
  106. package/hydration/ObjectHydrator.d.ts +3 -3
  107. package/hydration/ObjectHydrator.js +25 -28
  108. package/hydration/index.d.ts +2 -2
  109. package/hydration/index.js +2 -18
  110. package/index.d.ts +21 -21
  111. package/index.js +21 -46
  112. package/logging/DefaultLogger.d.ts +1 -1
  113. package/logging/DefaultLogger.js +9 -13
  114. package/logging/Logger.d.ts +1 -1
  115. package/logging/Logger.js +1 -2
  116. package/logging/SimpleLogger.d.ts +2 -2
  117. package/logging/SimpleLogger.js +2 -6
  118. package/logging/colors.js +1 -5
  119. package/logging/index.d.ts +4 -4
  120. package/logging/index.js +4 -20
  121. package/metadata/EntitySchema.d.ts +12 -4
  122. package/metadata/EntitySchema.js +41 -45
  123. package/metadata/MetadataDiscovery.d.ts +7 -7
  124. package/metadata/MetadataDiscovery.js +174 -177
  125. package/metadata/MetadataProvider.d.ts +2 -2
  126. package/metadata/MetadataProvider.js +4 -7
  127. package/metadata/MetadataStorage.d.ts +2 -2
  128. package/metadata/MetadataStorage.js +15 -19
  129. package/metadata/MetadataValidator.d.ts +4 -4
  130. package/metadata/MetadataValidator.js +49 -53
  131. package/metadata/ReflectMetadataProvider.d.ts +2 -2
  132. package/metadata/ReflectMetadataProvider.js +8 -12
  133. package/metadata/index.d.ts +6 -6
  134. package/metadata/index.js +6 -22
  135. package/naming-strategy/AbstractNamingStrategy.d.ts +2 -2
  136. package/naming-strategy/AbstractNamingStrategy.js +4 -8
  137. package/naming-strategy/EntityCaseNamingStrategy.d.ts +1 -1
  138. package/naming-strategy/EntityCaseNamingStrategy.js +2 -6
  139. package/naming-strategy/MongoNamingStrategy.d.ts +1 -1
  140. package/naming-strategy/MongoNamingStrategy.js +2 -6
  141. package/naming-strategy/NamingStrategy.d.ts +1 -1
  142. package/naming-strategy/NamingStrategy.js +1 -2
  143. package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -1
  144. package/naming-strategy/UnderscoreNamingStrategy.js +2 -6
  145. package/naming-strategy/index.d.ts +5 -5
  146. package/naming-strategy/index.js +5 -21
  147. package/package.json +5 -14
  148. package/platforms/ExceptionConverter.d.ts +2 -2
  149. package/platforms/ExceptionConverter.js +4 -8
  150. package/platforms/Platform.d.ts +10 -10
  151. package/platforms/Platform.js +57 -61
  152. package/platforms/index.d.ts +2 -2
  153. package/platforms/index.js +2 -18
  154. package/serialization/EntitySerializer.d.ts +2 -2
  155. package/serialization/EntitySerializer.js +36 -41
  156. package/serialization/EntityTransformer.d.ts +1 -1
  157. package/serialization/EntityTransformer.js +27 -31
  158. package/serialization/SerializationContext.d.ts +2 -2
  159. package/serialization/SerializationContext.js +10 -14
  160. package/serialization/index.d.ts +3 -3
  161. package/serialization/index.js +3 -19
  162. package/types/ArrayType.d.ts +3 -3
  163. package/types/ArrayType.js +7 -11
  164. package/types/BigIntType.d.ts +3 -3
  165. package/types/BigIntType.js +3 -6
  166. package/types/BlobType.d.ts +3 -3
  167. package/types/BlobType.js +2 -8
  168. package/types/BooleanType.d.ts +3 -3
  169. package/types/BooleanType.js +2 -6
  170. package/types/CharacterType.d.ts +3 -3
  171. package/types/CharacterType.js +2 -6
  172. package/types/DateTimeType.d.ts +3 -3
  173. package/types/DateTimeType.js +2 -6
  174. package/types/DateType.d.ts +3 -3
  175. package/types/DateType.js +2 -6
  176. package/types/DecimalType.d.ts +3 -3
  177. package/types/DecimalType.js +4 -7
  178. package/types/DoubleType.d.ts +3 -3
  179. package/types/DoubleType.js +3 -6
  180. package/types/EnumArrayType.d.ts +4 -4
  181. package/types/EnumArrayType.js +5 -10
  182. package/types/EnumType.d.ts +3 -3
  183. package/types/EnumType.js +2 -6
  184. package/types/FloatType.d.ts +3 -3
  185. package/types/FloatType.js +2 -6
  186. package/types/IntegerType.d.ts +3 -3
  187. package/types/IntegerType.js +2 -6
  188. package/types/IntervalType.d.ts +3 -3
  189. package/types/IntervalType.js +2 -6
  190. package/types/JsonType.d.ts +3 -3
  191. package/types/JsonType.js +2 -6
  192. package/types/MediumIntType.d.ts +3 -3
  193. package/types/MediumIntType.js +2 -6
  194. package/types/SmallIntType.d.ts +3 -3
  195. package/types/SmallIntType.js +2 -6
  196. package/types/StringType.d.ts +3 -3
  197. package/types/StringType.js +2 -6
  198. package/types/TextType.d.ts +3 -3
  199. package/types/TextType.js +2 -6
  200. package/types/TimeType.d.ts +3 -3
  201. package/types/TimeType.js +4 -8
  202. package/types/TinyIntType.d.ts +3 -3
  203. package/types/TinyIntType.js +3 -6
  204. package/types/Type.d.ts +2 -2
  205. package/types/Type.js +5 -9
  206. package/types/Uint8ArrayType.d.ts +3 -3
  207. package/types/Uint8ArrayType.js +3 -9
  208. package/types/UnknownType.d.ts +3 -3
  209. package/types/UnknownType.js +2 -6
  210. package/types/UuidType.d.ts +3 -3
  211. package/types/UuidType.js +2 -6
  212. package/types/index.d.ts +25 -25
  213. package/types/index.js +52 -79
  214. package/typings.d.ts +22 -20
  215. package/typings.js +34 -38
  216. package/unit-of-work/ChangeSet.d.ts +1 -1
  217. package/unit-of-work/ChangeSet.js +13 -17
  218. package/unit-of-work/ChangeSetComputer.d.ts +8 -7
  219. package/unit-of-work/ChangeSetComputer.js +26 -30
  220. package/unit-of-work/ChangeSetPersister.d.ts +7 -6
  221. package/unit-of-work/ChangeSetPersister.js +44 -47
  222. package/unit-of-work/CommitOrderCalculator.d.ts +1 -1
  223. package/unit-of-work/CommitOrderCalculator.js +6 -10
  224. package/unit-of-work/IdentityMap.d.ts +1 -1
  225. package/unit-of-work/IdentityMap.js +1 -5
  226. package/unit-of-work/UnitOfWork.d.ts +8 -7
  227. package/unit-of-work/UnitOfWork.js +171 -172
  228. package/unit-of-work/index.d.ts +6 -6
  229. package/unit-of-work/index.js +6 -22
  230. package/utils/AbstractSchemaGenerator.d.ts +6 -6
  231. package/utils/AbstractSchemaGenerator.js +7 -11
  232. package/utils/Configuration.d.ts +26 -27
  233. package/utils/Configuration.js +50 -55
  234. package/utils/ConfigurationLoader.d.ts +9 -8
  235. package/utils/ConfigurationLoader.js +71 -86
  236. package/utils/Cursor.d.ts +3 -3
  237. package/utils/Cursor.js +22 -25
  238. package/utils/DataloaderUtils.d.ts +4 -4
  239. package/utils/DataloaderUtils.js +12 -16
  240. package/utils/EntityComparator.d.ts +2 -2
  241. package/utils/EntityComparator.js +48 -52
  242. package/utils/NullHighlighter.d.ts +1 -1
  243. package/utils/NullHighlighter.js +1 -5
  244. package/utils/QueryHelper.d.ts +3 -3
  245. package/utils/QueryHelper.js +47 -51
  246. package/utils/RawQueryFragment.d.ts +1 -1
  247. package/utils/RawQueryFragment.js +16 -24
  248. package/utils/RequestContext.d.ts +2 -2
  249. package/utils/RequestContext.js +3 -7
  250. package/utils/TransactionContext.d.ts +1 -1
  251. package/utils/TransactionContext.js +4 -8
  252. package/utils/Utils.d.ts +16 -12
  253. package/utils/Utils.js +89 -93
  254. package/utils/clone.js +8 -11
  255. package/utils/index.d.ts +13 -13
  256. package/utils/index.js +13 -29
  257. package/utils/resolveContextProvider.d.ts +3 -3
  258. package/utils/resolveContextProvider.js +9 -12
  259. package/utils/upsert-utils.d.ts +3 -3
  260. package/utils/upsert-utils.js +5 -9
  261. package/index.mjs +0 -199
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntityComparator = void 0;
4
- const clone_1 = require("./clone");
5
- const enums_1 = require("../enums");
6
- const Utils_1 = require("./Utils");
7
- const JsonType_1 = require("../types/JsonType");
8
- const RawQueryFragment_1 = require("./RawQueryFragment");
9
- class EntityComparator {
1
+ import { clone } from './clone.js';
2
+ import { ReferenceKind } from '../enums.js';
3
+ import { compareArrays, compareBooleans, compareBuffers, compareObjects, equals, parseJsonSafe, Utils } from './Utils.js';
4
+ import { JsonType } from '../types/JsonType.js';
5
+ import { RawQueryFragment } from './RawQueryFragment.js';
6
+ export class EntityComparator {
10
7
  metadata;
11
8
  platform;
12
9
  comparators = new Map();
@@ -25,11 +22,11 @@ class EntityComparator {
25
22
  */
26
23
  diffEntities(entityName, a, b) {
27
24
  const comparator = this.getEntityComparator(entityName);
28
- return Utils_1.Utils.callCompiledFunction(comparator, a, b);
25
+ return Utils.callCompiledFunction(comparator, a, b);
29
26
  }
30
27
  matching(entityName, a, b) {
31
28
  const diff = this.diffEntities(entityName, a, b);
32
- return Utils_1.Utils.getObjectKeysSize(diff) === 0;
29
+ return Utils.getObjectKeysSize(diff) === 0;
33
30
  }
34
31
  /**
35
32
  * Removes ORM specific code from entities and prepares it for serializing. Used before change set computation.
@@ -37,21 +34,21 @@ class EntityComparator {
37
34
  */
38
35
  prepareEntity(entity) {
39
36
  const generator = this.getSnapshotGenerator(entity.constructor.name);
40
- return Utils_1.Utils.callCompiledFunction(generator, entity);
37
+ return Utils.callCompiledFunction(generator, entity);
41
38
  }
42
39
  /**
43
40
  * Maps database columns to properties.
44
41
  */
45
42
  mapResult(entityName, result) {
46
43
  const mapper = this.getResultMapper(entityName);
47
- return Utils_1.Utils.callCompiledFunction(mapper, result);
44
+ return Utils.callCompiledFunction(mapper, result);
48
45
  }
49
46
  /**
50
47
  * @internal Highly performance-sensitive method.
51
48
  */
52
49
  getPkGetter(meta) {
53
50
  const exists = this.pkGetters.get(meta.className);
54
- /* istanbul ignore next */
51
+ /* v8 ignore next 3 */
55
52
  if (exists) {
56
53
  return exists;
57
54
  }
@@ -60,7 +57,7 @@ class EntityComparator {
60
57
  if (meta.primaryKeys.length > 1) {
61
58
  lines.push(` const cond = {`);
62
59
  meta.primaryKeys.forEach(pk => {
63
- if (meta.properties[pk].kind !== enums_1.ReferenceKind.SCALAR) {
60
+ if (meta.properties[pk].kind !== ReferenceKind.SCALAR) {
64
61
  lines.push(` ${pk}: (entity${this.wrap(pk)} != null && (entity${this.wrap(pk)}.__entity || entity${this.wrap(pk)}.__reference)) ? entity${this.wrap(pk)}.__helper.getPrimaryKey() : entity${this.wrap(pk)},`);
65
62
  }
66
63
  else {
@@ -73,7 +70,7 @@ class EntityComparator {
73
70
  }
74
71
  else {
75
72
  const pk = meta.primaryKeys[0];
76
- if (meta.properties[pk].kind !== enums_1.ReferenceKind.SCALAR) {
73
+ if (meta.properties[pk].kind !== ReferenceKind.SCALAR) {
77
74
  lines.push(` if (entity${this.wrap(pk)} != null && (entity${this.wrap(pk)}.__entity || entity${this.wrap(pk)}.__reference)) {`);
78
75
  lines.push(` const pk = entity${this.wrap(pk)}.__helper.getPrimaryKey();`);
79
76
  if (meta.properties[pk].targetMeta.compositePK) {
@@ -92,7 +89,7 @@ class EntityComparator {
92
89
  }
93
90
  const code = `// compiled pk serializer for entity ${meta.className}\n`
94
91
  + `return function(entity) {\n${lines.join('\n')}\n}`;
95
- const pkSerializer = Utils_1.Utils.createFunction(context, code);
92
+ const pkSerializer = Utils.createFunction(context, code);
96
93
  this.pkGetters.set(meta.className, pkSerializer);
97
94
  return pkSerializer;
98
95
  }
@@ -101,7 +98,7 @@ class EntityComparator {
101
98
  */
102
99
  getPkGetterConverted(meta) {
103
100
  const exists = this.pkGettersConverted.get(meta.className);
104
- /* istanbul ignore next */
101
+ /* v8 ignore next 3 */
105
102
  if (exists) {
106
103
  return exists;
107
104
  }
@@ -110,7 +107,7 @@ class EntityComparator {
110
107
  if (meta.primaryKeys.length > 1) {
111
108
  lines.push(` const cond = {`);
112
109
  meta.primaryKeys.forEach(pk => {
113
- if (meta.properties[pk].kind !== enums_1.ReferenceKind.SCALAR) {
110
+ if (meta.properties[pk].kind !== ReferenceKind.SCALAR) {
114
111
  lines.push(` ${pk}: (entity${this.wrap(pk)} != null && (entity${this.wrap(pk)}.__entity || entity${this.wrap(pk)}.__reference)) ? entity${this.wrap(pk)}.__helper.getPrimaryKey(true) : entity${this.wrap(pk)},`);
115
112
  }
116
113
  else {
@@ -129,7 +126,7 @@ class EntityComparator {
129
126
  }
130
127
  else {
131
128
  const pk = meta.primaryKeys[0];
132
- if (meta.properties[pk].kind !== enums_1.ReferenceKind.SCALAR) {
129
+ if (meta.properties[pk].kind !== ReferenceKind.SCALAR) {
133
130
  lines.push(` if (entity${this.wrap(pk)} != null && (entity${this.wrap(pk)}.__entity || entity${this.wrap(pk)}.__reference)) return entity${this.wrap(pk)}.__helper.getPrimaryKey(true);`);
134
131
  }
135
132
  if (meta.properties[pk].customType) {
@@ -142,7 +139,7 @@ class EntityComparator {
142
139
  }
143
140
  const code = `// compiled pk getter (with converted custom types) for entity ${meta.className}\n`
144
141
  + `return function(entity) {\n${lines.join('\n')}\n}`;
145
- const pkSerializer = Utils_1.Utils.createFunction(context, code);
142
+ const pkSerializer = Utils.createFunction(context, code);
146
143
  this.pkGettersConverted.set(meta.className, pkSerializer);
147
144
  return pkSerializer;
148
145
  }
@@ -151,17 +148,17 @@ class EntityComparator {
151
148
  */
152
149
  getPkSerializer(meta) {
153
150
  const exists = this.pkSerializers.get(meta.className);
154
- /* istanbul ignore next */
151
+ /* v8 ignore next 3 */
155
152
  if (exists) {
156
153
  return exists;
157
154
  }
158
155
  const lines = [];
159
156
  const context = new Map();
160
- context.set('getCompositeKeyValue', (val) => Utils_1.Utils.flatten(Utils_1.Utils.getCompositeKeyValue(val, meta, 'convertToDatabaseValue', this.platform)));
157
+ context.set('getCompositeKeyValue', (val) => Utils.flatten(Utils.getCompositeKeyValue(val, meta, 'convertToDatabaseValue', this.platform)));
161
158
  if (meta.primaryKeys.length > 1) {
162
159
  lines.push(` const pks = entity.__helper.__pk ? getCompositeKeyValue(entity.__helper.__pk) : [`);
163
160
  meta.primaryKeys.forEach(pk => {
164
- if (meta.properties[pk].kind !== enums_1.ReferenceKind.SCALAR) {
161
+ if (meta.properties[pk].kind !== ReferenceKind.SCALAR) {
165
162
  lines.push(` (entity${this.wrap(pk)} != null && (entity${this.wrap(pk)}.__entity || entity${this.wrap(pk)}.__reference)) ? entity${this.wrap(pk)}.__helper.getSerializedPrimaryKey() : entity${this.wrap(pk)},`);
166
163
  }
167
164
  else {
@@ -169,11 +166,11 @@ class EntityComparator {
169
166
  }
170
167
  });
171
168
  lines.push(` ];`);
172
- lines.push(` return pks.join('${Utils_1.Utils.PK_SEPARATOR}');`);
169
+ lines.push(` return pks.join('${Utils.PK_SEPARATOR}');`);
173
170
  }
174
171
  else {
175
172
  const pk = meta.primaryKeys[0];
176
- if (meta.properties[pk].kind !== enums_1.ReferenceKind.SCALAR) {
173
+ if (meta.properties[pk].kind !== ReferenceKind.SCALAR) {
177
174
  lines.push(` if (entity${this.wrap(pk)} != null && (entity${this.wrap(pk)}.__entity || entity${this.wrap(pk)}.__reference)) return entity${this.wrap(pk)}.__helper.getSerializedPrimaryKey();`);
178
175
  }
179
176
  const serializedPrimaryKey = meta.props.find(p => p.serializedPrimaryKey);
@@ -184,7 +181,7 @@ class EntityComparator {
184
181
  }
185
182
  const code = `// compiled pk serializer for entity ${meta.className}\n`
186
183
  + `return function(entity) {\n${lines.join('\n')}\n}`;
187
- const pkSerializer = Utils_1.Utils.createFunction(context, code);
184
+ const pkSerializer = Utils.createFunction(context, code);
188
185
  this.pkSerializers.set(meta.className, pkSerializer);
189
186
  return pkSerializer;
190
187
  }
@@ -199,7 +196,7 @@ class EntityComparator {
199
196
  const meta = this.metadata.find(entityName);
200
197
  const lines = [];
201
198
  const context = new Map();
202
- context.set('clone', clone_1.clone);
199
+ context.set('clone', clone);
203
200
  context.set('cloneEmbeddable', (o) => this.platform.cloneEmbeddable(o)); // do not clone prototypes
204
201
  if (meta.discriminatorValue) {
205
202
  lines.push(` ret${this.wrap(meta.root.discriminatorColumn)} = '${meta.discriminatorValue}'`);
@@ -209,11 +206,11 @@ class EntityComparator {
209
206
  meta.comparableProps
210
207
  .filter(prop => {
211
208
  const root = getRootProperty(prop);
212
- return prop === root || root.kind !== enums_1.ReferenceKind.EMBEDDED;
209
+ return prop === root || root.kind !== ReferenceKind.EMBEDDED;
213
210
  })
214
211
  .forEach(prop => lines.push(this.getPropertySnapshot(meta, prop, context, this.wrap(prop.name), this.wrap(prop.name), [prop.name])));
215
212
  const code = `return function(entity) {\n const ret = {};\n${lines.join('\n')}\n return ret;\n}`;
216
- const snapshotGenerator = Utils_1.Utils.createFunction(context, code);
213
+ const snapshotGenerator = Utils.createFunction(context, code);
217
214
  this.snapshotGenerators.set(entityName, snapshotGenerator);
218
215
  return snapshotGenerator;
219
216
  }
@@ -318,10 +315,10 @@ class EntityComparator {
318
315
  lines.push(` ${this.propName(prop.fieldNames[0], 'mapped')} = true;`);
319
316
  lines.push(` }`);
320
317
  }
321
- else if (prop.kind === enums_1.ReferenceKind.EMBEDDED && (prop.object || meta.embeddable)) {
318
+ else if (prop.kind === ReferenceKind.EMBEDDED && (prop.object || meta.embeddable)) {
322
319
  const idx = this.tmpIndex++;
323
320
  context.set(`mapEmbeddedResult_${idx}`, (data) => {
324
- const item = (0, Utils_1.parseJsonSafe)(data);
321
+ const item = parseJsonSafe(data);
325
322
  if (Array.isArray(item)) {
326
323
  return item.map(row => row == null ? row : this.getResultMapper(prop.type)(row));
327
324
  }
@@ -332,7 +329,7 @@ class EntityComparator {
332
329
  lines.push(` ${this.propName(prop.fieldNames[0], 'mapped')} = true;`);
333
330
  lines.push(` }`);
334
331
  }
335
- else if (prop.kind !== enums_1.ReferenceKind.EMBEDDED) {
332
+ else if (prop.kind !== ReferenceKind.EMBEDDED) {
336
333
  lines.push(` if (typeof ${this.propName(prop.fieldNames[0])} !== 'undefined') {`);
337
334
  lines.push(` ret${this.wrap(prop.name)} = ${this.propName(prop.fieldNames[0])};`);
338
335
  lines.push(` ${this.propName(prop.fieldNames[0], 'mapped')} = true;`);
@@ -342,7 +339,7 @@ class EntityComparator {
342
339
  lines.push(` for (let k in result) { if (Object.hasOwn(result, k) && !mapped[k]) ret[k] = result[k]; }`);
343
340
  const code = `// compiled mapper for entity ${meta.className}\n`
344
341
  + `return function(result) {\n const ret = {};\n${lines.join('\n')}\n return ret;\n}`;
345
- const resultMapper = Utils_1.Utils.createFunction(context, code);
342
+ const resultMapper = Utils.createFunction(context, code);
346
343
  this.mappers.set(entityName, resultMapper);
347
344
  return resultMapper;
348
345
  }
@@ -408,7 +405,7 @@ class EntityComparator {
408
405
  if (!childProp.customType) {
409
406
  return false;
410
407
  }
411
- if (childProp.customType instanceof JsonType_1.JsonType) {
408
+ if (childProp.customType instanceof JsonType) {
412
409
  return !prop.object;
413
410
  }
414
411
  return true;
@@ -419,10 +416,10 @@ class EntityComparator {
419
416
  const childDataKey = meta.embeddable || prop.object ? dataKey + this.wrap(childProp.embedded[1]) : this.wrap(childProp.name);
420
417
  const childEntityKey = [...path, childProp.embedded[1]].map(k => this.wrap(k)).join('');
421
418
  const childCond = `typeof entity${childEntityKey} !== 'undefined'`;
422
- if (childProp.kind === enums_1.ReferenceKind.EMBEDDED) {
419
+ if (childProp.kind === ReferenceKind.EMBEDDED) {
423
420
  return this.getPropertySnapshot(meta, childProp, context, childDataKey, childEntityKey, [...path, childProp.embedded[1]], level + 1, prop.object);
424
421
  }
425
- if (childProp.kind !== enums_1.ReferenceKind.SCALAR) {
422
+ if (childProp.kind !== ReferenceKind.SCALAR) {
426
423
  return this.getPropertySnapshot(meta, childProp, context, childDataKey, childEntityKey, [...path, childProp.embedded[1]], level, prop.object)
427
424
  .split('\n').map(l => padding + l).join('\n');
428
425
  }
@@ -443,8 +440,8 @@ class EntityComparator {
443
440
  registerCustomType(prop, context) {
444
441
  const convertorKey = this.safeKey(prop.name);
445
442
  context.set(`convertToDatabaseValue_${convertorKey}`, (val) => {
446
- /* istanbul ignore if */
447
- if (RawQueryFragment_1.RawQueryFragment.isKnownFragment(val)) {
443
+ /* v8 ignore next 3 */
444
+ if (RawQueryFragment.isKnownFragment(val)) {
448
445
  return val;
449
446
  }
450
447
  return prop.customType.convertToDatabaseValue(val, this.platform, { mode: 'serialization' });
@@ -457,13 +454,13 @@ class EntityComparator {
457
454
  if (['number', 'string', 'boolean'].includes(prop.type.toLowerCase())) {
458
455
  return ret + ` ret${dataKey} = entity${entityKey}${unwrap};\n }\n`;
459
456
  }
460
- if (prop.kind === enums_1.ReferenceKind.EMBEDDED) {
457
+ if (prop.kind === ReferenceKind.EMBEDDED) {
461
458
  if (prop.array) {
462
459
  return this.getEmbeddedArrayPropertySnapshot(meta, prop, context, level, path, dataKey) + '\n';
463
460
  }
464
461
  return this.getEmbeddedPropertySnapshot(meta, prop, context, level, path, dataKey, object) + '\n';
465
462
  }
466
- if (prop.kind === enums_1.ReferenceKind.ONE_TO_ONE || prop.kind === enums_1.ReferenceKind.MANY_TO_ONE) {
463
+ if (prop.kind === ReferenceKind.ONE_TO_ONE || prop.kind === ReferenceKind.MANY_TO_ONE) {
467
464
  if (prop.mapToPk) {
468
465
  if (prop.customType) {
469
466
  const convertorKey = this.registerCustomType(prop, context);
@@ -475,7 +472,7 @@ class EntityComparator {
475
472
  }
476
473
  else {
477
474
  const toArray = (val) => {
478
- if (Utils_1.Utils.isPlainObject(val)) {
475
+ if (Utils.isPlainObject(val)) {
479
476
  return Object.values(val).map(v => toArray(v));
480
477
  }
481
478
  return val;
@@ -513,17 +510,17 @@ class EntityComparator {
513
510
  const meta = this.metadata.find(entityName);
514
511
  const lines = [];
515
512
  const context = new Map();
516
- context.set('compareArrays', Utils_1.compareArrays);
517
- context.set('compareBooleans', Utils_1.compareBooleans);
518
- context.set('compareBuffers', Utils_1.compareBuffers);
519
- context.set('compareObjects', Utils_1.compareObjects);
520
- context.set('equals', Utils_1.equals);
513
+ context.set('compareArrays', compareArrays);
514
+ context.set('compareBooleans', compareBooleans);
515
+ context.set('compareBuffers', compareBuffers);
516
+ context.set('compareObjects', compareObjects);
517
+ context.set('equals', equals);
521
518
  meta.comparableProps.forEach(prop => {
522
519
  lines.push(this.getPropertyComparator(prop, context));
523
520
  });
524
521
  const code = `// compiled comparator for entity ${meta.className}\n`
525
522
  + `return function(last, current) {\n const diff = {};\n${lines.join('\n')}\n return diff;\n}`;
526
- const comparator = Utils_1.Utils.createFunction(context, code);
523
+ const comparator = Utils.createFunction(context, code);
527
524
  this.comparators.set(entityName, comparator);
528
525
  return comparator;
529
526
  }
@@ -537,7 +534,7 @@ class EntityComparator {
537
534
  }
538
535
  getPropertyComparator(prop, context) {
539
536
  let type = prop.type.toLowerCase();
540
- if (prop.kind !== enums_1.ReferenceKind.SCALAR && prop.kind !== enums_1.ReferenceKind.EMBEDDED) {
537
+ if (prop.kind !== ReferenceKind.SCALAR && prop.kind !== ReferenceKind.EMBEDDED) {
541
538
  const meta2 = this.metadata.find(prop.type);
542
539
  if (meta2.primaryKeys.length > 1) {
543
540
  type = 'array';
@@ -595,10 +592,9 @@ class EntityComparator {
595
592
  */
596
593
  static isComparable(prop, root) {
597
594
  const virtual = prop.persist === false || prop.generated;
598
- const inverse = prop.kind === enums_1.ReferenceKind.ONE_TO_ONE && !prop.owner;
595
+ const inverse = prop.kind === ReferenceKind.ONE_TO_ONE && !prop.owner;
599
596
  const discriminator = prop.name === root.discriminatorColumn;
600
- const collection = prop.kind === enums_1.ReferenceKind.ONE_TO_MANY || prop.kind === enums_1.ReferenceKind.MANY_TO_MANY;
597
+ const collection = prop.kind === ReferenceKind.ONE_TO_MANY || prop.kind === ReferenceKind.MANY_TO_MANY;
601
598
  return !virtual && !collection && !inverse && !discriminator && !prop.version;
602
599
  }
603
600
  }
604
- exports.EntityComparator = EntityComparator;
@@ -1,4 +1,4 @@
1
- import type { Highlighter } from '../typings';
1
+ import type { Highlighter } from '../typings.js';
2
2
  export declare class NullHighlighter implements Highlighter {
3
3
  highlight(text: string): string;
4
4
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NullHighlighter = void 0;
4
- class NullHighlighter {
1
+ export class NullHighlighter {
5
2
  highlight(text) {
6
3
  return text;
7
4
  }
8
5
  }
9
- exports.NullHighlighter = NullHighlighter;
@@ -1,6 +1,6 @@
1
- import type { Dictionary, EntityMetadata, EntityProperty, FilterDef, FilterQuery } from '../typings';
2
- import type { Platform } from '../platforms';
3
- import type { MetadataStorage } from '../metadata/MetadataStorage';
1
+ import type { Dictionary, EntityMetadata, EntityProperty, FilterDef, FilterQuery } from '../typings.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { MetadataStorage } from '../metadata/MetadataStorage.js';
4
4
  export declare class QueryHelper {
5
5
  static readonly SUPPORTED_OPERATORS: string[];
6
6
  static processParams(params: unknown): any;
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryHelper = void 0;
4
- const Reference_1 = require("../entity/Reference");
5
- const Utils_1 = require("./Utils");
6
- const enums_1 = require("../enums");
7
- const JsonType_1 = require("../types/JsonType");
8
- const wrap_1 = require("../entity/wrap");
9
- const RawQueryFragment_1 = require("./RawQueryFragment");
10
- class QueryHelper {
1
+ import { Reference } from '../entity/Reference.js';
2
+ import { Utils } from './Utils.js';
3
+ import { GroupOperator, ReferenceKind } from '../enums.js';
4
+ import { JsonType } from '../types/JsonType.js';
5
+ import { helper } from '../entity/wrap.js';
6
+ import { RawQueryFragment, isRaw } from './RawQueryFragment.js';
7
+ export class QueryHelper {
11
8
  static SUPPORTED_OPERATORS = ['>', '<', '<=', '>=', '!', '!='];
12
9
  static processParams(params) {
13
- if (Reference_1.Reference.isReference(params)) {
10
+ if (Reference.isReference(params)) {
14
11
  params = params.unwrap();
15
12
  }
16
- if (Utils_1.Utils.isEntity(params)) {
17
- if ((0, wrap_1.helper)(params).__meta.compositePK) {
18
- return (0, wrap_1.helper)(params).__primaryKeys;
13
+ if (Utils.isEntity(params)) {
14
+ if (helper(params).__meta.compositePK) {
15
+ return helper(params).__primaryKeys;
19
16
  }
20
- return (0, wrap_1.helper)(params).getPrimaryKey();
17
+ return helper(params).getPrimaryKey();
21
18
  }
22
19
  if (params === undefined) {
23
20
  return null;
@@ -25,13 +22,13 @@ class QueryHelper {
25
22
  if (Array.isArray(params)) {
26
23
  return params.map(item => QueryHelper.processParams(item));
27
24
  }
28
- if (Utils_1.Utils.isPlainObject(params)) {
25
+ if (Utils.isPlainObject(params)) {
29
26
  QueryHelper.processObjectParams(params);
30
27
  }
31
28
  return params;
32
29
  }
33
30
  static processObjectParams(params = {}) {
34
- Utils_1.Utils.keys(params).forEach(k => {
31
+ Utils.keys(params).forEach(k => {
35
32
  params[k] = QueryHelper.processParams(params[k]);
36
33
  });
37
34
  return params;
@@ -40,19 +37,19 @@ class QueryHelper {
40
37
  if (Array.isArray(where)) {
41
38
  where.forEach((item, i) => {
42
39
  if (this.inlinePrimaryKeyObjects(item, meta, metadata, key)) {
43
- where[i] = Utils_1.Utils.getPrimaryKeyValues(item, meta.primaryKeys, false);
40
+ where[i] = Utils.getPrimaryKeyValues(item, meta.primaryKeys, false);
44
41
  }
45
42
  });
46
43
  }
47
- if (!Utils_1.Utils.isPlainObject(where) || (key && meta.properties[key]?.customType instanceof JsonType_1.JsonType)) {
44
+ if (!Utils.isPlainObject(where) || (key && meta.properties[key]?.customType instanceof JsonType)) {
48
45
  return false;
49
46
  }
50
- if (meta.primaryKeys.every(pk => pk in where) && Utils_1.Utils.getObjectKeysSize(where) === meta.primaryKeys.length) {
51
- return !!key && !enums_1.GroupOperator[key] && Object.keys(where).every(k => !Utils_1.Utils.isPlainObject(where[k]) || Object.keys(where[k]).every(v => {
52
- if (Utils_1.Utils.isOperator(v, false)) {
47
+ if (meta.primaryKeys.every(pk => pk in where) && Utils.getObjectKeysSize(where) === meta.primaryKeys.length) {
48
+ return !!key && !GroupOperator[key] && Object.keys(where).every(k => !Utils.isPlainObject(where[k]) || Object.keys(where[k]).every(v => {
49
+ if (Utils.isOperator(v, false)) {
53
50
  return false;
54
51
  }
55
- if (meta.properties[k].primary && [enums_1.ReferenceKind.ONE_TO_ONE, enums_1.ReferenceKind.MANY_TO_ONE].includes(meta.properties[k].kind)) {
52
+ if (meta.properties[k].primary && [ReferenceKind.ONE_TO_ONE, ReferenceKind.MANY_TO_ONE].includes(meta.properties[k].kind)) {
56
53
  return this.inlinePrimaryKeyObjects(where[k], meta.properties[k].targetMeta, metadata, v);
57
54
  }
58
55
  return true;
@@ -61,7 +58,7 @@ class QueryHelper {
61
58
  Object.keys(where).forEach(k => {
62
59
  const meta2 = metadata.find(meta.properties[k]?.type) || meta;
63
60
  if (this.inlinePrimaryKeyObjects(where[k], meta2, metadata, k)) {
64
- where[k] = Utils_1.Utils.getPrimaryKeyValues(where[k], meta2.primaryKeys, true);
61
+ where[k] = Utils.getPrimaryKeyValues(where[k], meta2.primaryKeys, true);
65
62
  }
66
63
  });
67
64
  return false;
@@ -75,27 +72,27 @@ class QueryHelper {
75
72
  QueryHelper.inlinePrimaryKeyObjects(where, meta, metadata);
76
73
  }
77
74
  if (platform.getConfig().get('ignoreUndefinedInQuery') && where && typeof where === 'object') {
78
- Utils_1.Utils.dropUndefinedProperties(where);
75
+ Utils.dropUndefinedProperties(where);
79
76
  }
80
77
  where = QueryHelper.processParams(where) ?? {};
81
- /* istanbul ignore next */
82
- if (!root && Utils_1.Utils.isPrimaryKey(where)) {
78
+ /* v8 ignore next 3 */
79
+ if (!root && Utils.isPrimaryKey(where)) {
83
80
  return where;
84
81
  }
85
- if (meta && Utils_1.Utils.isPrimaryKey(where, meta.compositePK)) {
86
- where = { [Utils_1.Utils.getPrimaryKeyHash(meta.primaryKeys)]: where };
82
+ if (meta && Utils.isPrimaryKey(where, meta.compositePK)) {
83
+ where = { [Utils.getPrimaryKeyHash(meta.primaryKeys)]: where };
87
84
  }
88
85
  if (Array.isArray(where) && root) {
89
- const rootPrimaryKey = meta ? Utils_1.Utils.getPrimaryKeyHash(meta.primaryKeys) : entityName;
86
+ const rootPrimaryKey = meta ? Utils.getPrimaryKeyHash(meta.primaryKeys) : entityName;
90
87
  let cond = { [rootPrimaryKey]: { $in: where } };
91
88
  // @ts-ignore
92
89
  // detect tuple comparison, use `$or` in case the number of constituents don't match
93
- if (meta && !where.every(c => Utils_1.Utils.isPrimaryKey(c) || (Array.isArray(c) && c.length === meta.primaryKeys.length && c.every(i => Utils_1.Utils.isPrimaryKey(i))))) {
90
+ if (meta && !where.every(c => Utils.isPrimaryKey(c) || (Array.isArray(c) && c.length === meta.primaryKeys.length && c.every(i => Utils.isPrimaryKey(i))))) {
94
91
  cond = { $or: where };
95
92
  }
96
93
  return QueryHelper.processWhere({ ...options, where: cond, root: false });
97
94
  }
98
- if (!Utils_1.Utils.isPlainObject(where)) {
95
+ if (!Utils.isPlainObject(where)) {
99
96
  return where;
100
97
  }
101
98
  return Object.keys(where).reduce((o, key) => {
@@ -103,34 +100,34 @@ class QueryHelper {
103
100
  const prop = this.findProperty(key, options);
104
101
  const keys = prop?.joinColumns?.length ?? 0;
105
102
  const composite = keys > 1;
106
- if (Array.isArray(value) && value.length === 0 && RawQueryFragment_1.RawQueryFragment.isKnownFragment(key)) {
103
+ if (Array.isArray(value) && value.length === 0 && RawQueryFragment.isKnownFragment(key)) {
107
104
  o[key] = value;
108
105
  return o;
109
106
  }
110
- if (key in enums_1.GroupOperator) {
107
+ if (key in GroupOperator) {
111
108
  o[key] = value.map((sub) => QueryHelper.processWhere({ ...options, where: sub, root }));
112
109
  return o;
113
110
  }
114
111
  // wrap top level operators (except platform allowed operators) with PK
115
- if (Utils_1.Utils.isOperator(key) && root && meta && !platform.isAllowedTopLevelOperator(key)) {
116
- const rootPrimaryKey = Utils_1.Utils.getPrimaryKeyHash(meta.primaryKeys);
112
+ if (Utils.isOperator(key) && root && meta && !platform.isAllowedTopLevelOperator(key)) {
113
+ const rootPrimaryKey = Utils.getPrimaryKeyHash(meta.primaryKeys);
117
114
  o[rootPrimaryKey] = { [key]: QueryHelper.processWhere({ ...options, where: value, root: false }) };
118
115
  return o;
119
116
  }
120
- if (prop?.customType && convertCustomTypes && !(0, RawQueryFragment_1.isRaw)(value)) {
117
+ if (prop?.customType && convertCustomTypes && !isRaw(value)) {
121
118
  value = QueryHelper.processCustomType(prop, value, platform, undefined, true);
122
119
  }
123
- const isJsonProperty = prop?.customType instanceof JsonType_1.JsonType && Utils_1.Utils.isPlainObject(value) && !(0, RawQueryFragment_1.isRaw)(value) && Object.keys(value)[0] !== '$eq';
120
+ const isJsonProperty = prop?.customType instanceof JsonType && Utils.isPlainObject(value) && !isRaw(value) && Object.keys(value)[0] !== '$eq';
124
121
  if (isJsonProperty) {
125
122
  return this.processJsonCondition(o, value, [prop.fieldNames[0]], platform, aliased);
126
123
  }
127
- if (Array.isArray(value) && !Utils_1.Utils.isOperator(key) && !QueryHelper.isSupportedOperator(key) && !key.includes('?') && options.type !== 'orderBy') {
124
+ if (Array.isArray(value) && !Utils.isOperator(key) && !QueryHelper.isSupportedOperator(key) && !key.includes('?') && options.type !== 'orderBy') {
128
125
  // comparing single composite key - use $eq instead of $in
129
126
  const op = composite && !value.every(v => Array.isArray(v)) ? '$eq' : '$in';
130
127
  o[key] = { [op]: value };
131
128
  return o;
132
129
  }
133
- if (Utils_1.Utils.isPlainObject(value)) {
130
+ if (Utils.isPlainObject(value)) {
134
131
  o[key] = QueryHelper.processWhere({
135
132
  ...options,
136
133
  where: value,
@@ -152,7 +149,7 @@ class QueryHelper {
152
149
  if (Array.isArray(options)) {
153
150
  options.forEach(filter => opts[filter] = true);
154
151
  }
155
- else if (Utils_1.Utils.isPlainObject(options)) {
152
+ else if (Utils.isPlainObject(options)) {
156
153
  Object.keys(options).forEach(filter => opts[filter] = options[filter]);
157
154
  }
158
155
  return Object.keys(filters)
@@ -172,9 +169,9 @@ class QueryHelper {
172
169
  return filter.default || filterName in options;
173
170
  }
174
171
  static processCustomType(prop, cond, platform, key, fromQuery) {
175
- if (Utils_1.Utils.isPlainObject(cond)) {
176
- return Utils_1.Utils.keys(cond).reduce((o, k) => {
177
- if (Utils_1.Utils.isOperator(k, true) || prop.referencedPKs?.includes(k)) {
172
+ if (Utils.isPlainObject(cond)) {
173
+ return Utils.keys(cond).reduce((o, k) => {
174
+ if (Utils.isOperator(k, true) || prop.referencedPKs?.includes(k)) {
178
175
  o[k] = QueryHelper.processCustomType(prop, cond[k], platform, k, fromQuery);
179
176
  }
180
177
  else {
@@ -183,15 +180,15 @@ class QueryHelper {
183
180
  return o;
184
181
  }, {});
185
182
  }
186
- if (key && Utils_1.Utils.isJsonKeyOperator(key)) {
183
+ if (key && Utils.isJsonKeyOperator(key)) {
187
184
  return Array.isArray(cond)
188
185
  ? platform.marshallArray(cond)
189
186
  : cond;
190
187
  }
191
- if (Array.isArray(cond) && !(key && Utils_1.Utils.isArrayOperator(key))) {
188
+ if (Array.isArray(cond) && !(key && Utils.isArrayOperator(key))) {
192
189
  return cond.map(v => QueryHelper.processCustomType(prop, v, platform, key, fromQuery));
193
190
  }
194
- if ((0, RawQueryFragment_1.isRaw)(cond)) {
191
+ if (isRaw(cond)) {
195
192
  return cond;
196
193
  }
197
194
  return prop.customType.convertToDatabaseValue(cond, platform, { fromQuery, key, mode: 'query' });
@@ -200,8 +197,8 @@ class QueryHelper {
200
197
  return !!QueryHelper.SUPPORTED_OPERATORS.find(op => key === op);
201
198
  }
202
199
  static processJsonCondition(o, value, path, platform, alias) {
203
- if (Utils_1.Utils.isPlainObject(value) && !Object.keys(value).some(k => Utils_1.Utils.isOperator(k))) {
204
- Utils_1.Utils.keys(value).forEach(k => {
200
+ if (Utils.isPlainObject(value) && !Object.keys(value).some(k => Utils.isOperator(k))) {
201
+ Utils.keys(value).forEach(k => {
205
202
  this.processJsonCondition(o, value[k], [...path, k], platform, alias);
206
203
  });
207
204
  return o;
@@ -219,7 +216,7 @@ class QueryHelper {
219
216
  if (Array.isArray(value)) {
220
217
  return typeof value[0];
221
218
  }
222
- if (Utils_1.Utils.isPlainObject(value) && Object.keys(value).every(k => Utils_1.Utils.isOperator(k))) {
219
+ if (Utils.isPlainObject(value) && Object.keys(value).every(k => Utils.isOperator(k))) {
223
220
  return this.getValueType(Object.values(value)[0]);
224
221
  }
225
222
  return typeof value;
@@ -233,4 +230,3 @@ class QueryHelper {
233
230
  return meta?.properties[propName];
234
231
  }
235
232
  }
236
- exports.QueryHelper = QueryHelper;
@@ -1,5 +1,5 @@
1
1
  import { inspect } from 'node:util';
2
- import type { AnyString, Dictionary, EntityKey } from '../typings';
2
+ import type { AnyString, Dictionary, EntityKey } from '../typings.js';
3
3
  export declare class RawQueryFragment {
4
4
  #private;
5
5
  readonly sql: string;