Function
widenType
(node: Record<string, unknown>)
Source from the content-addressed store, hash-verified
| 1011 | } |
| 1012 | |
| 1013 | function widenType(node: Record<string, unknown>): Record<string, unknown> { |
| 1014 | const t = node.type |
| 1015 | if (typeof t === "string") return t === "null" ? node : { ...node, type: [t, "null"] } |
| 1016 | if (Array.isArray(t)) return t.includes("null") ? node : { ...node, type: [...t, "null"] } |
| 1017 | return node |
| 1018 | } |
| 1019 | |
| 1020 | /** |
| 1021 | * Resolves a `$ref` string by looking up the last path segment in a |
Tested by
no test coverage detected