c2-mongoose 2.1.428 → 2.1.429

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.
@@ -46,7 +46,7 @@ var PopulateFlowItem = /** @class */ (function () {
46
46
  // if ((typeFirst === 'Array') && !rest?.length) {
47
47
  // return
48
48
  // }
49
- if (!((_c = fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.options) === null || _c === void 0 ? void 0 : _c.ref) && !((_e = (_d = fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.options) === null || _d === void 0 ? void 0 : _d.type) === null || _e === void 0 ? void 0 : _e.ref)) {
49
+ if (!((_c = fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.options) === null || _c === void 0 ? void 0 : _c.ref) && !((_e = (_d = fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.options) === null || _d === void 0 ? void 0 : _d.type[0]) === null || _e === void 0 ? void 0 : _e.ref)) {
50
50
  throw new Error("[1]No reference found for populate field: ".concat(populateField));
51
51
  }
52
52
  var modelName = (_f = fieldDefinition.options.ref) !== null && _f !== void 0 ? _f : fieldDefinition.options.type.ref;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.428",
3
+ "version": "2.1.429",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,7 +39,7 @@ class PopulateFlowItem {
39
39
  // }
40
40
 
41
41
 
42
- if (!fieldDefinition?.options?.ref && !fieldDefinition?.options?.type?.ref) {
42
+ if (!fieldDefinition?.options?.ref && !fieldDefinition?.options?.type[0]?.ref) {
43
43
  throw new Error(`[1]No reference found for populate field: ${populateField}`);
44
44
  }
45
45