@ronin/compiler 0.13.1-leo-ron-1071-experimental-281 → 0.13.1-leo-ron-1071-experimental-283
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/index.js +1 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -778,19 +778,6 @@ var flatten = (obj, prefix = "", res = {}) => {
|
|
778
778
|
var omit = (obj, properties) => Object.fromEntries(
|
779
779
|
Object.entries(obj).filter(([key]) => !properties.includes(key))
|
780
780
|
);
|
781
|
-
var expand = (obj) => {
|
782
|
-
return Object.entries(obj).reduce((res, [key, val]) => {
|
783
|
-
key.split(".").reduce((acc, part, i, arr) => {
|
784
|
-
if (i === arr.length - 1) {
|
785
|
-
acc[part] = val;
|
786
|
-
} else {
|
787
|
-
acc[part] = typeof acc[part] === "object" && acc[part] !== null ? acc[part] : {};
|
788
|
-
}
|
789
|
-
return acc[part];
|
790
|
-
}, res);
|
791
|
-
return res;
|
792
|
-
}, {});
|
793
|
-
};
|
794
781
|
var getProperty = (obj, path) => {
|
795
782
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
796
783
|
};
|
@@ -2188,7 +2175,7 @@ var handleTo = (models, model, statementParams, queryType, dependencyStatements,
|
|
2188
2175
|
}
|
2189
2176
|
const symbol = getSymbol(toInstruction);
|
2190
2177
|
if (symbol?.type === "query") {
|
2191
|
-
|
2178
|
+
const { queryModel: subQueryModelSlug, queryInstructions: subQueryInstructions } = splitQuery(symbol.value);
|
2192
2179
|
const subQueryModel = getModelBySlug(models, subQueryModelSlug);
|
2193
2180
|
if (subQueryInstructions?.selecting) {
|
2194
2181
|
const currentFields = new Set(subQueryInstructions.selecting);
|
@@ -2209,14 +2196,6 @@ var handleTo = (models, model, statementParams, queryType, dependencyStatements,
|
|
2209
2196
|
const defaultFieldsToAdd = subQuerySelectedFields ? Object.entries(flatten(defaultFields)).filter(([key]) => {
|
2210
2197
|
return !subQuerySelectedFields.includes(key);
|
2211
2198
|
}) : [];
|
2212
|
-
if (defaultFieldsToAdd.length > 0) {
|
2213
|
-
const defaultFieldsObject = expand(Object.fromEntries(defaultFieldsToAdd));
|
2214
|
-
if (!subQueryInstructions) subQueryInstructions = {};
|
2215
|
-
subQueryInstructions.including = {
|
2216
|
-
...defaultFieldsObject,
|
2217
|
-
...subQueryInstructions.including
|
2218
|
-
};
|
2219
|
-
}
|
2220
2199
|
let statement2 = "";
|
2221
2200
|
if (subQuerySelectedFields) {
|
2222
2201
|
const selectedFields = [
|
package/package.json
CHANGED