@bedrockio/model 0.1.23 → 0.1.24

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.
@@ -221,10 +221,18 @@ function applyScopeExtension(scope, definition) {
221
221
  ...options
222
222
  } = scope;
223
223
  for (let [key, val] of Object.entries(normalizeAttributes(attributes))) {
224
- definition[key] = {
225
- ...val,
226
- ...options
227
- };
224
+ if ((0, _utils.isSchemaTypedef)(val)) {
225
+ definition[key] = {
226
+ ...val,
227
+ ...options
228
+ };
229
+ } else {
230
+ definition[key] = {
231
+ type: 'Object',
232
+ attributes: val,
233
+ ...options
234
+ };
235
+ }
228
236
  }
229
237
  }
230
238
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/model",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Bedrock utilities for model creation.",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/schema.js CHANGED
@@ -230,10 +230,18 @@ function isScopeExtension(obj) {
230
230
  function applyScopeExtension(scope, definition) {
231
231
  const { type, attributes, ...options } = scope;
232
232
  for (let [key, val] of Object.entries(normalizeAttributes(attributes))) {
233
- definition[key] = {
234
- ...val,
235
- ...options,
236
- };
233
+ if (isSchemaTypedef(val)) {
234
+ definition[key] = {
235
+ ...val,
236
+ ...options,
237
+ };
238
+ } else {
239
+ definition[key] = {
240
+ type: 'Object',
241
+ attributes: val,
242
+ ...options,
243
+ };
244
+ }
237
245
  }
238
246
  }
239
247