@fireproof/core 0.20.0-dev-preview-50 → 0.20.0-dev-preview-51
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.cjs +12 -5
- package/index.cjs.map +1 -1
- package/index.js +12 -5
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/package.json +1 -1
- package/tests/fireproof/crdt.test.ts +1 -1
- package/tests/fireproof/database.test.ts +13 -0
- package/tests/fireproof/fireproof.test.ts +11 -8
package/index.cjs
CHANGED
@@ -1962,7 +1962,7 @@ var Index = class {
|
|
1962
1962
|
if (this.mapFn) {
|
1963
1963
|
if (mapFn) {
|
1964
1964
|
if (this.mapFn.toString() !== mapFn.toString()) {
|
1965
|
-
|
1965
|
+
this.logger.Error().Msg("cannot apply different mapFn app2");
|
1966
1966
|
}
|
1967
1967
|
}
|
1968
1968
|
} else {
|
@@ -1971,7 +1971,7 @@ var Index = class {
|
|
1971
1971
|
}
|
1972
1972
|
if (this.mapFnString) {
|
1973
1973
|
if (this.mapFnString !== mapFn.toString()) {
|
1974
|
-
|
1974
|
+
this.logger.Error().Str("mapFnString", this.mapFnString).Str("mapFn", mapFn.toString()).Msg("cannot apply different mapFn app");
|
1975
1975
|
}
|
1976
1976
|
} else {
|
1977
1977
|
this.mapFnString = mapFn.toString();
|
@@ -4404,6 +4404,9 @@ function sanitizeDocumentFields(obj) {
|
|
4404
4404
|
return item;
|
4405
4405
|
});
|
4406
4406
|
} else if (typeof obj === "object" && obj !== null) {
|
4407
|
+
if (obj instanceof Date) {
|
4408
|
+
return obj.toISOString();
|
4409
|
+
}
|
4407
4410
|
const typedObj = obj;
|
4408
4411
|
const result = {};
|
4409
4412
|
for (const key in typedObj) {
|
@@ -4411,8 +4414,12 @@ function sanitizeDocumentFields(obj) {
|
|
4411
4414
|
const value = typedObj[key];
|
4412
4415
|
if (value === null || !Number.isNaN(value) && value !== void 0) {
|
4413
4416
|
if (typeof value === "object" && !key.startsWith("_")) {
|
4414
|
-
|
4415
|
-
|
4417
|
+
if (value instanceof Date) {
|
4418
|
+
result[key] = value.toISOString();
|
4419
|
+
} else {
|
4420
|
+
const sanitized = sanitizeDocumentFields(value);
|
4421
|
+
result[key] = sanitized;
|
4422
|
+
}
|
4416
4423
|
} else {
|
4417
4424
|
result[key] = value;
|
4418
4425
|
}
|
@@ -5299,6 +5306,6 @@ __export(file_exports, {
|
|
5299
5306
|
|
5300
5307
|
// src/version.ts
|
5301
5308
|
var PACKAGE_VERSION = Object.keys({
|
5302
|
-
"0.20.0-dev-preview-
|
5309
|
+
"0.20.0-dev-preview-51": "xxxx"
|
5303
5310
|
})[0];
|
5304
5311
|
//# sourceMappingURL=index.cjs.map
|