(schema: StringMap, path: Ref, name: string, isInferred: boolean)
| 410 | } |
| 411 | |
| 412 | function toType(schema: StringMap, path: Ref, name: string, isInferred: boolean): TypeRef { |
| 413 | // FIXME: This fromJS thing is ugly and inefficient. Schemas aren't |
| 414 | // big, so it most likely doesn't matter. |
| 415 | const immutablePath = makeImmutablePath(path); |
| 416 | const maybeType = typeForPath.get(immutablePath); |
| 417 | if (maybeType !== undefined) { |
| 418 | return maybeType; |
| 419 | } |
| 420 | const result = convertToType(schema, path, name, isInferred); |
| 421 | setTypeForPath(immutablePath, result); |
| 422 | return result; |
| 423 | } |
| 424 | |
| 425 | const rootPathElement: PathElement = { kind: PathElementKind.Root }; |
| 426 | const rootType = toType(root, List<PathElement>([rootPathElement]), topLevelName, false); |
no test coverage detected
searching dependent graphs…