Skip to content

Commit e35816a

Browse files
committed
chore: prChecks
1 parent d6605e4 commit e35816a

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

ark/docs/public/llms.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ Add a type-only symbol to an existing type so that the only values that satisfy
13861386
const Even = type("(number % 2)#even")
13871387
type Even = typeof Even.infer
13881388

1389-
const good: Even = even.assert(2)
1389+
const good: Even = Even.assert(2)
13901390
// TypeScript: Type 'number' is not assignable to type 'Brand<number, "even">'
13911391
const bad: Even = 5
13921392
```
@@ -1397,10 +1397,10 @@ const bad: Even = 5
13971397

13981398
```ts
13991399
// @noErrors
1400-
const even = type.number.divisibleBy(2).brand("even")
1400+
const Even = type.number.divisibleBy(2).brand("even")
14011401
type Even = typeof Even.infer
14021402

1403-
const good: Even = even.assert(2)
1403+
const good: Even = Even.assert(2)
14041404
// TypeScript: Type 'number' is not assignable to type 'Brand<number, "even">'
14051405
const bad: Even = 5
14061406
```

ark/json-schema/__tests__/array.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ contextualize(() => {
9191

9292
attest(
9393
() =>
94-
// @ts-expect-error
94+
// @ts-ignore Suppress 'excessively deep and possibly infinite' error
9595
jsonSchemaToType({
9696
type: "array",
9797
additionalItems: { type: "string" },

ark/json-schema/composition.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export type inferJsonSchemaComposition<schema, t> =
1515
"allOf" extends keyof schema ?
1616
t extends never ?
1717
t // "allOf" has incompatible schemas, so don't keep looking
18-
: schema["allOf"] extends [infer firstSchema, ...infer restOfSchemas] ?
18+
: schema["allOf"] extends (
19+
readonly [infer firstSchema, ...infer restOfSchemas]
20+
) ?
1921
inferJsonSchemaComposition<
2022
{ allOf: restOfSchemas },
2123
inferJsonSchema<firstSchema, t>
@@ -31,6 +33,7 @@ export type inferJsonSchemaComposition<schema, t> =
3133

3234
const parseAllOfJsonSchema = (jsonSchemas: readonly JsonSchema[]): Type =>
3335
jsonSchemas
36+
// @ts-ignore Suppress 'excessivevely deep and possibly infinite' error
3437
.map(jsonSchema => jsonSchemaToType(jsonSchema as never))
3538
.reduce((acc, validator) => acc.and(validator))
3639

ark/json-schema/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type inferJsonSchema<schema, t = unknown> =
4848
: schema extends JsonSchema.Numeric ? t & number
4949
: schema extends JsonSchema.Array ? t & inferJsonSchemaArray<schema>
5050
: schema extends JsonSchema.Object ? t & inferJsonSchemaObject<schema>
51-
: schema extends JsonSchema.String ? t & inferJsonSchemaString<schema>
51+
: schema extends JsonSchema.String ? t & inferJsonSchemaString
5252
: t extends {} ? t
5353
: ErrorMessage<"Failed to infer JSON Schema">
5454

ark/json-schema/string.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { rootSchema, type Intersection } from "@ark/schema"
22
import type { Out, Type } from "arktype"
33
import { JsonSchemaScope, type StringSchema } from "./scope.ts"
44

5-
export type inferJsonSchemaString<schema> = string
5+
export type inferJsonSchemaString = string
66

77
export const parseStringJsonSchema: Type<
88
(In: StringSchema) => Out<Type<string, any>>,

0 commit comments

Comments
 (0)