(path: Ref, name: string, additional: StringMap)
| 298 | } |
| 299 | |
| 300 | function makeMap(path: Ref, name: string, additional: StringMap): TypeRef { |
| 301 | let valuesType: TypeRef | undefined = undefined; |
| 302 | let mustSet = false; |
| 303 | const result = typeBuilder.getLazyMapType(() => { |
| 304 | mustSet = true; |
| 305 | return valuesType; |
| 306 | }); |
| 307 | setTypeForPath(path, result); |
| 308 | path = path.push({ kind: PathElementKind.AdditionalProperty }); |
| 309 | valuesType = toType(additional, path, pluralize.singular(name), true); |
| 310 | if (mustSet) { |
| 311 | (result.deref() as MapType).setValues(valuesType); |
| 312 | } |
| 313 | return result; |
| 314 | } |
| 315 | |
| 316 | function fromTypeName(schema: StringMap, path: Ref, inferredName: string, typeName: string): TypeRef { |
| 317 | const [name, isInferred] = getName(schema, inferredName, true); |
no test coverage detected
searching dependent graphs…