edmaxlabs-core 2.5.1 → 2.5.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.
- package/dist/index.cjs +1 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -414,20 +414,12 @@ function validateDocumentData(data, operation) {
|
|
|
414
414
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
415
415
|
throw new Error(`${operation}: data must be a plain object`);
|
|
416
416
|
}
|
|
417
|
-
const reservedFields = ["
|
|
417
|
+
const reservedFields = ["_id", "_createdAt", "_updatedAt", "_deleted", "_v", "_s"];
|
|
418
418
|
for (const field of reservedFields) {
|
|
419
419
|
if (field in data) {
|
|
420
420
|
throw new Error(`${operation}: '${field}' is a reserved field and cannot be set manually`);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
try {
|
|
424
|
-
const size = JSON.stringify(data).length;
|
|
425
|
-
if (size > 1024 * 1024) {
|
|
426
|
-
throw new Error(`${operation}: document too large (max 1MB)`);
|
|
427
|
-
}
|
|
428
|
-
} catch {
|
|
429
|
-
throw new Error(`${operation}: data contains circular references`);
|
|
430
|
-
}
|
|
431
423
|
}
|
|
432
424
|
var DocumentRef = class {
|
|
433
425
|
constructor(app, collection, id) {
|