Normalize a JSON-Schema `type` (which may be an array like `["string","null"]`).
(node: JsonSchemaNode)
| 74 | |
| 75 | /** Normalize a JSON-Schema `type` (which may be an array like `["string","null"]`). */ |
| 76 | function primaryType(node: JsonSchemaNode): string | undefined { |
| 77 | if (Array.isArray(node.type)) return node.type.find(t => t !== 'null'); |
| 78 | return node.type; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Repair `raw` so it conforms to `schema`, fixing ONLY unambiguous type mismatches. |
no outgoing calls
no test coverage detected