(cases: any, kind: PathElementKind.OneOf | PathElementKind.AnyOf)
| 376 | [name, isInferred] = getName(schema, name, isInferred); |
| 377 | |
| 378 | function convertOneOrAnyOf(cases: any, kind: PathElementKind.OneOf | PathElementKind.AnyOf): TypeRef { |
| 379 | if (!Array.isArray(cases)) { |
| 380 | return panic(`oneOf or anyOf is not an array: ${cases}`); |
| 381 | } |
| 382 | // FIXME: This cast shouldn't be necessary, but TypeScript forces our hand. |
| 383 | const types = cases.map((t, index) => |
| 384 | toType(checkStringMap(t), path.push({ kind, index } as any), name, isInferred) |
| 385 | ); |
| 386 | return unifyTypes(types, name, isInferred); |
| 387 | } |
| 388 | |
| 389 | if (schema.$ref !== undefined) { |
| 390 | const [ref, refName] = parseRef(schema.$ref); |
no test coverage detected
searching dependent graphs…