@aeriajs/core 0.0.241 → 0.0.243

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.
@@ -330,10 +330,19 @@ const buildLookupPipeline = (refMap, options = {}) => {
330
330
  localField = `${getTempName(path)}.${refName}`;
331
331
  }
332
332
  else {
333
- const localFieldPath = newPath.map(([segment]) => segment).join('.');
333
+ let separator = '_';
334
334
  localField = path[0] && path[0][1]
335
- ? `_${localFieldPath}`
336
- : localFieldPath;
335
+ ? '_'
336
+ : '';
337
+ for (let i = 0; i < newPath.length; i++) {
338
+ localField += newPath[i][0];
339
+ if (newPath[i + 1]) {
340
+ if (!newPath[i][1] || !newPath[i + 1][1]) {
341
+ separator = '.';
342
+ }
343
+ localField += separator;
344
+ }
345
+ }
337
346
  }
338
347
  rootPipeline.unshift({
339
348
  $lookup: {
@@ -317,8 +317,17 @@ export const buildLookupPipeline = (refMap, options = {}) => {
317
317
  if (reference.isRecursive) {
318
318
  localField = `${getTempName(path)}.${refName}`;
319
319
  } else {
320
- const localFieldPath = newPath.map(([segment]) => segment).join(".");
321
- localField = path[0] && path[0][1] ? `_${localFieldPath}` : localFieldPath;
320
+ let separator = "_";
321
+ localField = path[0] && path[0][1] ? "_" : "";
322
+ for (let i = 0; i < newPath.length; i++) {
323
+ localField += newPath[i][0];
324
+ if (newPath[i + 1]) {
325
+ if (!newPath[i][1] || !newPath[i + 1][1]) {
326
+ separator = ".";
327
+ }
328
+ localField += separator;
329
+ }
330
+ }
322
331
  }
323
332
  rootPipeline.unshift({
324
333
  $lookup: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/core",
3
- "version": "0.0.241",
3
+ "version": "0.0.243",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "aeriaMain": "tests/fixtures/aeriaMain.js",
@@ -42,11 +42,11 @@
42
42
  "mongodb-memory-server": "^9.2.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@aeriajs/builtins": "^0.0.241",
45
+ "@aeriajs/builtins": "^0.0.243",
46
46
  "@aeriajs/common": "^0.0.136",
47
47
  "@aeriajs/entrypoint": "^0.0.140",
48
48
  "@aeriajs/http": "^0.0.164",
49
- "@aeriajs/security": "^0.0.241",
49
+ "@aeriajs/security": "^0.0.243",
50
50
  "@aeriajs/types": "^0.0.118",
51
51
  "@aeriajs/validation": "^0.0.152"
52
52
  },
@@ -65,6 +65,6 @@
65
65
  "build:cjs": "tsc",
66
66
  "build:esm": "esbuild './src/**/*.ts' --outdir=dist --out-extension:.js=.mjs && pnpm build:esm-transform",
67
67
  "build:esm-transform": "pnpm -w esm-transform $PWD/dist",
68
- "postinstall": "if test -f dist/__scripts__/postinstall.js; then node dist/__scripts__/postinstall.js; fi"
68
+ "postinstall": "node dist/__scripts__/postinstall.js || true"
69
69
  }
70
70
  }