Skip to content

Commit 4cfb54a

Browse files
committed
fix some places not accepting $fn in the schema
1 parent 09d0926 commit 4cfb54a

File tree

2 files changed

+98254
-13926
lines changed

2 files changed

+98254
-13926
lines changed

src/jsonschema.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ import { InputConfig } from "./types";
22

33
type With$fn<T> = {
44
[K in keyof T]:
5-
| (T[K] extends (infer U)[]
6-
? With$fn<U>[] // handle arrays recursively
7-
: T[K] extends object
8-
? With$fn<T[K]> // handle objects recursively
9-
: T[K]) // retain original type
10-
| `${string}$ex$fn_REPLACER`;
5+
| (T[K] extends (infer U)[] // Handle arrays recursively
6+
? With$fn<U>[]
7+
: With$fn<T[K]>) // Handle everything else recursively
8+
| `${string}$ex$fn_REPLACER`; // Apply extension to everything
119
};
1210

1311
export type JsonSchemaRoot = With$fn<InputConfig>;

0 commit comments

Comments
 (0)