added initial $record

This commit is contained in:
dswbx
2025-08-05 13:20:00 +02:00
parent 5e5f0ef70f
commit 3e2938f77d
13 changed files with 430 additions and 148 deletions

View File

@@ -35,16 +35,15 @@ export function rescursiveClean(
export function excludePropertyTypes(
input: s.ObjectSchema<any, any>,
props: (new (...args: any[]) => s.Schema)[],
props: (instance: s.Schema | unknown) => boolean,
): s.TProperties {
const properties = { ...input.properties };
return transformObject(properties, (value, key) => {
for (const prop of props) {
if (value instanceof prop) {
return undefined;
}
if (props(value)) {
return undefined;
}
return value;
});
}