Skip to content

Commit

Permalink
Apply prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanWachter1507 committed Dec 20, 2023
1 parent 7bda5b0 commit a0a0b07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/types/jtd-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
: // enums - only accepts union of string literals
// TODO we can't actually check that everything in the union was specified
true extends IsEnum<Exclude<T, null>>
// eslint-disable-next-line @typescript-eslint/array-type
? {enum: ReadonlyArray<EnumString<Exclude<T, null>>>}
? // eslint-disable-next-line @typescript-eslint/array-type
{enum: ReadonlyArray<EnumString<Exclude<T, null>>>}
: // arrays - only accepts arrays, could be array of unions to be resolved later
true extends IsElements<Exclude<T, null>>
? T extends readonly (infer E)[]
Expand Down
9 changes: 8 additions & 1 deletion spec/types/jtd-schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ describe("JTDSchemaType", () => {
const constEnumSchema = {enum: ["a", "b"]} as const
const enumerateConst: JTDSchemaType<"a" | "b"> = constEnumSchema

void [enumerate, enumerateMissing, enumerateNumber, enumerateString, enumerateNull, enumerateConst]
void [
enumerate,
enumerateMissing,
enumerateNumber,
enumerateString,
enumerateNull,
enumerateConst,
]
})

it("should typecheck elements schemas", () => {
Expand Down

0 comments on commit a0a0b07

Please sign in to comment.