Skip to content

Conversation

@mlewando
Copy link

@mlewando mlewando commented Nov 6, 2025

I noted that the return type of getSchemaType is not correct. It looks to be derived from

export const SCHEMA_TYPES = ["string", "number", "integer", "boolean", "null", "array", "object"]

but the actual declaration was

export function getSchemaType(node: SchemaNode, data: unknown): keyof typeof SCHEMA_TYPES | undefined

The keyof typeof SCHEMA_TYPES is actually "length" | "push" | "pop" | "map" ... which is wrong.

I made the SCHEMA_TYPES a const array and created new simple type:

export type SchemaType = (typeof SCHEMA_TYPES)[number];

to fix that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant