convex-ents 0.4.1 → 0.4.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.
package/dist/writer.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'convex/server';
2
2
  import 'convex/values';
3
- export { E as EdgeChanges, a as WithEdgeInserts, c as WithEdgePatches, b as WithEdges, W as WriterImplBase } from './index--8O_7LM9.js';
3
+ export { E as EdgeChanges, a as WithEdgeInserts, c as WithEdgePatches, b as WithEdges, W as WriterImplBase } from './index-WGlX_PmZ.js';
4
4
  import './schema.js';
5
5
  import './deletion.js';
package/dist/writer.js CHANGED
@@ -609,7 +609,7 @@ function entWrapper(fields, ctx, entDefinitions, table) {
609
609
  writable: false,
610
610
  configurable: false
611
611
  });
612
- Object.entries(entDefinitions[table].defaults).map(
612
+ Object.entries(entDefinitions[table]?.defaults ?? []).map(
613
613
  ([field, value]) => {
614
614
  if (doc[field] === void 0) {
615
615
  doc[field] = value;
@@ -680,7 +680,7 @@ var PromiseEntWriterImpl = class extends PromiseEntOrNullImpl {
680
680
  ).collect() : []
681
681
  )
682
682
  )
683
- )).map((edgeDoc) => edgeDoc._id);
683
+ )).flat().map((edgeDoc) => edgeDoc._id);
684
684
  edges[key] = {
685
685
  add,
686
686
  removeEdges