uranio 1.0.2 → 1.0.3

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.
@@ -28,6 +28,6 @@
28
28
  "typescript": "^5.2.2"
29
29
  },
30
30
  "dependencies": {
31
- "uranio": "1.0.2"
31
+ "uranio": "1.0.3"
32
32
  }
33
33
  }
@@ -283,6 +283,10 @@ function _format_value(value: unknown): string {
283
283
  if(value instanceof RegExp){
284
284
  return value.source;
285
285
  }
286
+ if(value instanceof Date){
287
+ // Return a unique placeholder that won't conflict with the date string
288
+ return `__DATE_PLACEHOLDER_${value.getTime()}__`;
289
+ }
286
290
  switch (typeof value) {
287
291
  case 'string': {
288
292
  query_string = `"${value.replaceAll('"', '"')}"`;
@@ -227,7 +227,8 @@ function _replace_value_with_param(
227
227
  continue;
228
228
  }
229
229
  if(v instanceof Date){
230
- final_query = final_query.replaceAll(` ${v.toString()}`, ` :${k}`);
230
+ const placeholder = `__DATE_PLACEHOLDER_${v.getTime()}__`;
231
+ final_query = final_query.replaceAll(` ${placeholder}`, ` :${k}`);
231
232
  continue;
232
233
  }
233
234
  switch (typeof v) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uranio",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Uranio is a type-safe ODM for MongoDB",
5
5
  "main": "dist/index.js",
6
6
  "repository": {