@bedrockio/model 0.1.32 → 0.1.33
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/cjs/include.js +10 -1
- package/package.json +1 -1
- package/src/include.js +10 -1
package/dist/cjs/include.js
CHANGED
|
@@ -243,7 +243,16 @@ function setNodePath(node, options) {
|
|
|
243
243
|
node[key] = null;
|
|
244
244
|
}
|
|
245
245
|
} else if (type === 'virtual') {
|
|
246
|
-
node[key]
|
|
246
|
+
node[key] ||= {};
|
|
247
|
+
const virtual = schema.virtual(key);
|
|
248
|
+
setNodePath(node[key], {
|
|
249
|
+
// @ts-ignore
|
|
250
|
+
modelName: virtual.options.ref,
|
|
251
|
+
path: path.slice(parts.length),
|
|
252
|
+
depth: depth + 1,
|
|
253
|
+
exclude
|
|
254
|
+
});
|
|
255
|
+
halt = true;
|
|
247
256
|
} else if (type !== 'nested') {
|
|
248
257
|
throw new Error(`Unknown path on ${modelName}: ${key}.`);
|
|
249
258
|
}
|
package/package.json
CHANGED
package/src/include.js
CHANGED
|
@@ -228,7 +228,16 @@ function setNodePath(node, options) {
|
|
|
228
228
|
node[key] = null;
|
|
229
229
|
}
|
|
230
230
|
} else if (type === 'virtual') {
|
|
231
|
-
node[key]
|
|
231
|
+
node[key] ||= {};
|
|
232
|
+
const virtual = schema.virtual(key);
|
|
233
|
+
setNodePath(node[key], {
|
|
234
|
+
// @ts-ignore
|
|
235
|
+
modelName: virtual.options.ref,
|
|
236
|
+
path: path.slice(parts.length),
|
|
237
|
+
depth: depth + 1,
|
|
238
|
+
exclude,
|
|
239
|
+
});
|
|
240
|
+
halt = true;
|
|
232
241
|
} else if (type !== 'nested') {
|
|
233
242
|
throw new Error(`Unknown path on ${modelName}: ${key}.`);
|
|
234
243
|
}
|