@aeriajs/core 0.0.294 → 0.0.295
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.
|
@@ -22,14 +22,14 @@ export const getReferences = async (properties, options = {}) => {
|
|
|
22
22
|
if (refProperty) {
|
|
23
23
|
const description = throwIfError(await getCollectionAsset(refProperty.$ref, 'description'));
|
|
24
24
|
if (refProperty.inline || refProperty.populate) {
|
|
25
|
-
if (refProperty.populate && refProperty.populate.length === 0) {
|
|
25
|
+
if (Array.isArray(refProperty.populate) && refProperty.populate.length === 0) {
|
|
26
26
|
continue;
|
|
27
27
|
}
|
|
28
28
|
const deepReferences = await getReferences(description.properties, {
|
|
29
29
|
depth: depth + 1,
|
|
30
30
|
maxDepth: refProperty.populateDepth || maxDepth,
|
|
31
31
|
memoize: `${memoize}.${propName}`,
|
|
32
|
-
populate: refProperty.populate
|
|
32
|
+
populate: Array.isArray(refProperty.populate)
|
|
33
33
|
? Array.from(refProperty.populate)
|
|
34
34
|
: undefined,
|
|
35
35
|
isArrayOrArrayElement: 'items' in property,
|
|
@@ -39,7 +39,9 @@ export const getReferences = async (properties, options = {}) => {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
const { indexes = description.indexes || [] } = refProperty;
|
|
42
|
-
|
|
42
|
+
if (Array.isArray(refProperty.populate) || !refProperty.populate) {
|
|
43
|
+
reference.populate = (refProperty.populate || []).concat(indexes.filter((index) => typeof index === 'string'));
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
47
|
const entrypoint = 'items' in property
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.295",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"aeriaMain": "tests/fixtures/aeriaMain.js",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"mongodb-memory-server": "^11.0.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@aeriajs/builtins": "^0.0.
|
|
44
|
-
"@aeriajs/common": "^0.0.
|
|
45
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
46
|
-
"@aeriajs/http": "^0.0.
|
|
47
|
-
"@aeriajs/security": "^0.0.
|
|
48
|
-
"@aeriajs/types": "^0.0.
|
|
49
|
-
"@aeriajs/validation": "^0.0.
|
|
43
|
+
"@aeriajs/builtins": "^0.0.295",
|
|
44
|
+
"@aeriajs/common": "^0.0.168",
|
|
45
|
+
"@aeriajs/entrypoint": "^0.0.176",
|
|
46
|
+
"@aeriajs/http": "^0.0.207",
|
|
47
|
+
"@aeriajs/security": "^0.0.295",
|
|
48
|
+
"@aeriajs/types": "^0.0.141",
|
|
49
|
+
"@aeriajs/validation": "^0.0.192"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"mongodb": "^7.1.0",
|