@fireproof/core 0.20.0-dev-preview-50 → 0.20.0-dev-preview-52

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.
package/index.js CHANGED
@@ -1912,7 +1912,7 @@ var Index = class {
1912
1912
  if (this.mapFn) {
1913
1913
  if (mapFn) {
1914
1914
  if (this.mapFn.toString() !== mapFn.toString()) {
1915
- throw this.logger.Error().Msg("cannot apply different mapFn app2").AsError();
1915
+ this.logger.Error().Msg("cannot apply different mapFn app2");
1916
1916
  }
1917
1917
  }
1918
1918
  } else {
@@ -1921,7 +1921,7 @@ var Index = class {
1921
1921
  }
1922
1922
  if (this.mapFnString) {
1923
1923
  if (this.mapFnString !== mapFn.toString()) {
1924
- throw this.logger.Error().Str("mapFnString", this.mapFnString).Str("mapFn", mapFn.toString()).Msg("cannot apply different mapFn app").AsError();
1924
+ this.logger.Error().Str("mapFnString", this.mapFnString).Str("mapFn", mapFn.toString()).Msg("cannot apply different mapFn app");
1925
1925
  }
1926
1926
  } else {
1927
1927
  this.mapFnString = mapFn.toString();
@@ -4354,6 +4354,9 @@ function sanitizeDocumentFields(obj) {
4354
4354
  return item;
4355
4355
  });
4356
4356
  } else if (typeof obj === "object" && obj !== null) {
4357
+ if (obj instanceof Date) {
4358
+ return obj.toISOString();
4359
+ }
4357
4360
  const typedObj = obj;
4358
4361
  const result = {};
4359
4362
  for (const key in typedObj) {
@@ -4361,8 +4364,12 @@ function sanitizeDocumentFields(obj) {
4361
4364
  const value = typedObj[key];
4362
4365
  if (value === null || !Number.isNaN(value) && value !== void 0) {
4363
4366
  if (typeof value === "object" && !key.startsWith("_")) {
4364
- const sanitized = sanitizeDocumentFields(value);
4365
- result[key] = sanitized;
4367
+ if (value instanceof Date) {
4368
+ result[key] = value.toISOString();
4369
+ } else {
4370
+ const sanitized = sanitizeDocumentFields(value);
4371
+ result[key] = sanitized;
4372
+ }
4366
4373
  } else {
4367
4374
  result[key] = value;
4368
4375
  }
@@ -5249,7 +5256,7 @@ __export(file_exports, {
5249
5256
 
5250
5257
  // src/version.ts
5251
5258
  var PACKAGE_VERSION = Object.keys({
5252
- "0.20.0-dev-preview-50": "xxxx"
5259
+ "0.20.0-dev-preview-52": "xxxx"
5253
5260
  })[0];
5254
5261
  export {
5255
5262
  CRDTImpl,