( schema: PrimitiveSchemaDefinition, )
| 41 | * Check if schema is a single-select enum (either legacy `enum` format or new `oneOf` format) |
| 42 | */ |
| 43 | export const isEnumSchema = ( |
| 44 | schema: PrimitiveSchemaDefinition, |
| 45 | ): schema is EnumSchema => { |
| 46 | return schema.type === 'string' && ('enum' in schema || 'oneOf' in schema) |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Check if schema is a multi-select enum (`type: "array"` with `items.enum` or `items.anyOf`) |
no outgoing calls
no test coverage detected