@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.
- package/dist/cjs/schema.js +12 -4
- package/package.json +1 -1
- package/src/schema.js +12 -4
package/dist/cjs/schema.js
CHANGED
|
@@ -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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
|