speedly 2.0.21 → 2.0.22

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.
@@ -27,7 +27,7 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
27
27
  __path = config.path;
28
28
  model = require(path_1.default.join(...(config.type == "external"
29
29
  ? [require.main?.filename || "./", __path]
30
- : ["../model"]), collectionName));
30
+ : ["../../model"]), collectionName));
31
31
  if (model.default)
32
32
  model = model.default;
33
33
  const actionHandler = {
@@ -489,7 +489,9 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
489
489
  }
490
490
  if (config?.response) {
491
491
  const action = queryState.action?.match(/create|update|delet/i)?.[0] || "find";
492
- if (queryState.action == "aggregate" && config.first && data[0]?.content.length)
492
+ if (queryState.action == "aggregate" &&
493
+ config.first &&
494
+ data[0]?.content.length)
493
495
  data[0].content.length = data[0].content[0];
494
496
  const resBody = queryState.action == "aggregate"
495
497
  ? {
@@ -27,7 +27,7 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
27
27
  __path = config.path;
28
28
  model = require(path_1.default.join(...(config.type == "external"
29
29
  ? [require.main?.filename || "./", __path]
30
- : ["../model"]), collectionName));
30
+ : ["../../model"]), collectionName));
31
31
  if (model.default)
32
32
  model = model.default;
33
33
  const actionHandler = {
@@ -489,7 +489,9 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
489
489
  }
490
490
  if (config?.response) {
491
491
  const action = queryState.action?.match(/create|update|delet/i)?.[0] || "find";
492
- if (queryState.action == "aggregate" && config.first && data[0]?.content.length)
492
+ if (queryState.action == "aggregate" &&
493
+ config.first &&
494
+ data[0]?.content.length)
493
495
  data[0].content.length = data[0].content[0];
494
496
  const resBody = queryState.action == "aggregate"
495
497
  ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedly",
3
- "version": "2.0.21",
3
+ "version": "2.0.22",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",