formatting

This commit is contained in:
Josh Hawkins
2026-03-11 11:07:23 -05:00
parent a0849b104c
commit 98e9e79881
3 changed files with 12 additions and 21 deletions
+2 -7
View File
@@ -566,9 +566,7 @@ function removePropertyBySegments(
if (segments.length === 0 || !isSchemaObject(schema)) return;
const [head, ...rest] = segments;
const props = schema.properties as
| Record<string, RJSFSchema>
| undefined;
const props = schema.properties as Record<string, RJSFSchema> | undefined;
if (rest.length === 0) {
// Terminal segment — delete the property
@@ -594,10 +592,7 @@ function removePropertyBySegments(
if (head === "*") {
// Wildcard segment — descend into additionalProperties
if (isSchemaObject(schema.additionalProperties)) {
removePropertyBySegments(
schema.additionalProperties as RJSFSchema,
rest,
);
removePropertyBySegments(schema.additionalProperties as RJSFSchema, rest);
}
} else if (props && head in props && isSchemaObject(props[head])) {
removePropertyBySegments(props[head], rest);