Skip to content

Commit 824445a

Browse files
committed
constraints -> siblings
1 parent b0c8265 commit 824445a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/compileValueSchema.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ export function compileValueSchema(
4141
): namedTypes.Identifier {
4242
if ('$ref' in schema) {
4343
const resolved = compiler.resolveRef(schema);
44-
const { $ref, ...constraints } = schema;
45-
if (Object.keys(constraints).length > 0) {
46-
// Apply the constraints to the additionalProperties schema if it exists
44+
const { $ref, ...siblings } = schema;
45+
if (Object.keys(siblings).length > 0) {
46+
// Apply the siblings to the additionalProperties schema if it exists
4747
if (resolved.type === 'object' && typeof resolved.additionalProperties === 'object') {
4848
return compileValueSchema(compiler, {
4949
...resolved,
50-
additionalProperties: { ...resolved.additionalProperties, ...constraints },
50+
additionalProperties: { ...resolved.additionalProperties, ...siblings },
5151
});
5252
}
5353

54-
// Apply the constraints to the items schema if it exists
54+
// Apply the siblings to the items schema if it exists
5555
if (resolved.type === 'array' && typeof resolved.items === 'object') {
5656
return compileValueSchema(compiler, {
5757
...resolved,
58-
items: { ...resolved.items, ...constraints },
58+
items: { ...resolved.items, ...siblings },
5959
});
6060
}
6161

6262
// Otherwise merge directly into the resolved schema
63-
return compileValueSchema(compiler, { ...resolved, ...constraints });
63+
return compileValueSchema(compiler, { ...resolved, ...siblings });
6464
}
6565

6666
return compileValueSchema(compiler, resolved);

0 commit comments

Comments
 (0)